├── CHANGELOG ├── COPYING ├── INSTALL ├── LICENSE ├── README.md ├── UPDATE.txt ├── aligner.php ├── alignment.php ├── api.php ├── cli ├── .htaccess ├── align ├── export ├── import ├── renumber └── update ├── config ├── config.php ├── default_permissions.php ├── export_customization.php └── login_handler.php ├── css ├── cupertino │ ├── images │ │ ├── ui-bg_diagonals-thick_90_eeeeee_40x40.png │ │ ├── ui-bg_flat_15_cd0a0a_40x100.png │ │ ├── ui-bg_glass_100_e4f1fb_1x400.png │ │ ├── ui-bg_glass_50_3baae3_1x400.png │ │ ├── ui-bg_glass_80_d7ebf9_1x400.png │ │ ├── ui-bg_highlight-hard_100_f2f5f7_1x100.png │ │ ├── ui-bg_highlight-hard_70_000000_1x100.png │ │ ├── ui-bg_highlight-soft_100_deedf7_1x100.png │ │ ├── ui-bg_highlight-soft_25_ffef8f_1x100.png │ │ ├── ui-icons_2694e8_256x240.png │ │ ├── ui-icons_2e83ff_256x240.png │ │ ├── ui-icons_3d80b3_256x240.png │ │ ├── ui-icons_72a7cf_256x240.png │ │ └── ui-icons_ffffff_256x240.png │ └── ui.css └── intertext.css ├── docker ├── Dockerfile ├── Readme.md ├── config.php ├── docker-compose.yml ├── import │ ├── test_en.txt │ ├── test_en.xml │ ├── test_pl.txt │ └── test_pl.xml ├── init │ └── 01.sql └── mysql_charset.cnf ├── header.php ├── help.php ├── help_cs.php ├── hunalign ├── _none_.dic └── process.sh ├── icons ├── .DS_Store ├── .directory ├── COPYING.LESSER ├── LICENSE ├── add.png ├── arrow-down-double.png ├── arrow-down.png ├── arrow-up-double.png ├── arrow-up.png ├── arrow.png ├── asc.png ├── automatic.png ├── changelog.png ├── desc.png ├── dialog-ok-apply.png ├── dialog-ok.png ├── document-edit.png ├── document-export.png ├── document-import.png ├── document-new.png ├── document-save.png ├── edit-delete-shred.png ├── edit-delete.png ├── edit-rename.png ├── flag-red.png ├── flag-yellow.png ├── format-list-ordered.png ├── format-list-unordered.png ├── go-down.png ├── go-first.png ├── go-jump.png ├── go-last.png ├── go-next-view.png ├── go-next.png ├── go-prev.png ├── go-previous-view.png ├── go-up.png ├── help-contents.png ├── journal.png ├── layer-visible-off.png ├── layer-visible-on.png ├── legalmoves.png ├── mark.png ├── merge.png ├── nomark.png ├── remove.png ├── search.png ├── status_unknown.png ├── swap.png └── to-check.png ├── index.php ├── init.php ├── intertext.sql ├── js ├── jeip.js ├── jquery-1.3.2.min.js ├── jxs.js ├── ui.core.js └── ui.progressbar.js ├── lib_intertext.php ├── progress.php ├── tca2 ├── no-cs.cfg └── no-cs.dic ├── textmanager.php ├── triggers ├── alstat_closed └── alstat_finished ├── update-1.5.sql ├── update-2.0.php ├── update-2.2.php ├── users.php └── users.sql /CHANGELOG: -------------------------------------------------------------------------------- 1 | Release 2.3 (2020-10-07) 2 | ------------------------------ 3 | 4 | Improvements: 5 | - use MySQLi for PHP7 compatibility 6 | - settings split into several files in the config/ directory 7 | - permanent login added (does it really work as expected?) - update of configuration necessary! 8 | - ignore changes in changelog if current element is marked as deleted and beyond that point in time (element IDs reused by the database may associate changes with wrong elements!) 9 | - option to export alignments (from CLI) without empty segments 10 | - allow text segments to be larger than 64kB 11 | 12 | Fixes: 13 | - ensure consistency of editing when someone edits several texts at once 14 | - fix listing of "all" alignments of one text only and creating new alignments with no selected base version 15 | 16 | Release 2.2 (2014-11-10) 17 | ------------------------ 18 | 19 | Improvements: 20 | - support for transactions for better robustness of more complex actions (read UPDATE.txt if updating!) 21 | - possibility to turn off fulltext search (both transactions and fulltext search are not supported 22 | by MySQL <5.6) at the same time 23 | - display changelog of alignment changes if available (for supervisors) 24 | - updated documentation (help) 25 | 26 | Release 2.1.1 (2014-05-28) 27 | -------------------------- 28 | 29 | Fixes: 30 | - textmanager failure on empty database 31 | 32 | Release 2.1 (2014-05-15) 33 | -------------------------- 34 | 35 | - annoying complaints from cli/import 36 | - added paging in the alignment list 37 | - added paging in the text manager 38 | - added filter in textmanager 39 | - list all alignments of one text (all versions) 40 | - batch changes in alignment manager 41 | - (api.php) version 2 - support for faster merge inquiry 42 | - (api.php) version 2 - support for faster doc_changelist inquiry 43 | 44 | Release 2.0.1 (2013-09-16) 45 | -------------------------- 46 | 47 | - synchronization (api.php): fix failures caused by clients sending time zone info in timestamps 48 | - synchronization (api.php): enforce renumbering in all cases (initially imported documents may have unique IDs but non-standard - we are always importing alignment with standard numbering) 49 | 50 | 51 | Release 2.0 (2013-05-14) 52 | ------------------------ 53 | 54 | - new config option $MERGE_UNCONFIRMED_FREELY to ignore unconfirmed alignments when checking for merge conflicts 55 | - new config option $DENY_EMPTY_UPDATES to deny creative users "updating" with empty text (i.e. deleting text completely from elements) 56 | - new modes for supervisors; combination of manual status update with automatic rolling (paging) 57 | - XML validation of imported documents now optional 58 | - proper error reporting on invalid XML import 59 | 60 | Fixes: 61 | 62 | - empty segments not shown when at the end of a page 63 | - export of alignment omits last position if there is is exactly a multiple of 200 positions 64 | - small fix of text upload form's behaviour on import failure 65 | 66 | Release 2.0rc2 (no release) 67 | --------------------------- 68 | 69 | Improvements: 70 | 71 | - added filter (search) in the alignment list 72 | - cli/align script now supports "force" option (-f) which will delete any existing alignment before creating the new one 73 | 74 | Fixes: 75 | 76 | - minor fixes of error messages in api.php 77 | - user editor forgot to switch to the user database (in lib_intertext.php) 78 | - blank page when jumping to unchecked segments and there are none 79 | - PHP now requiring default timezone to be set (should appear in settings.php!) 80 | 81 | Release 2.0rc1 (2012-07-12) 82 | --------------------------- 83 | - Read UPDATE.txt before upgrading your current installation! 84 | 85 | Features: 86 | - synchronization of texts and alignments with "InterText editor" clients 87 | - new state of alignment: "remote editor" - for alignments beeing worked on externally in InterText editor; the alignment is reserved for a particular remote editor (user) using InterText editor desktop application in sychronization with the server 88 | - added simple interface for management of users 89 | - ability to split and merge (parent) container elements - i.e. to insert and remove paragraph breaks 90 | - added new permissions and settings: $UPLOAD_MAXUSERLEVEL_CLIENT (to set the lowest level of users able of uploading new texts and alignments from InterText editor application; by default set to administrators only), $DOWNLOAD_TXTVER_MAXUSERLEVEL (to set the lowest level of users able to download text versions from the server into InterText editor in order to create new alignments; by default set to administrators only), $DOWNLOAD_TXTVER_FILTER (regular expression to match text versions (by name) which can be downloaded into InterText editor in order to create new alignments; by default all versions, i.e. '.*') 91 | - added "index.php" as a symbolic link to "aligner.php" 92 | - updated manual reflecting the new features (help) 93 | 94 | Release 1.7.1 95 | ------------- 96 | - changed files: aligner.php 97 | 98 | Fixes: 99 | - search and bookmarks search did only work in "auto roll" modes 100 | 101 | Release 1.7 102 | ----------- 103 | - changed files: lib_intertext.php, aligner.php, css/intertext.css, cli/export, settings.php 104 | - (optional changes: help.php, help_cs.php) 105 | 106 | Features: 107 | - added logging of all alignment changes on demand (turned off by default; add into settings.php: 108 | $LOG_ALIGN_CHANGES=true; to activate) (no interface for this changelog; no undo!) 109 | - added new possible option to settings.php: $FORCE_SIMPLE_NUMBERING = true; (turned off by default) 110 | which enforces single level element renumbering and (as another side effect) makes it possible 111 | to keep original ID attributes for all elements from the original document except of the 112 | alignable ones (which *must* yield to renumbering) 113 | - added export with long IDs based on the (original) filename (as used by the ECPC project) 114 | (settings.php & aligner.php) 115 | - now recursively showing history of changes for the deleted (< merged-in) elements as well 116 | 117 | Fixes: 118 | - previously "fixed" problem with importing 0:1 or 1:0 alignments from TCA2 appeared again when 119 | reversing the imported alignment 120 | 121 | Release 1.6.1 122 | ------------- 123 | - changed files: lib_intertext.php 124 | 125 | - fixed the newly added check for gaps in imported alignments (it did not really work, but broke 126 | the import) (lib_intertext.php) 127 | - fixed problem with importing 0:1 or 1:0 alignments from TCA2, which links those to the parent 128 | element instead (lib_intertext.php) 129 | 130 | Release 1.6 131 | ----------- 132 | - changed files: lib_intertext.php, aligner.php, icons/changelog.png 133 | - (optional changes: help.php, help_cs.php) 134 | 135 | Features: 136 | - imported alignments are checked for completeness; if there is a gap in the alignment, the 137 | import fails 138 | - the changed/edited elements can show their history of changes and their contents can be replaced 139 | with some previous contents (state) (un-splitting or un-merging is still not possible but 140 | manually, though!) 141 | - searching for changed/edited elements 142 | - searching both sides (versions) at the same time 143 | 144 | 145 | Release 1.5 146 | ----------- 147 | - database structure modified! (apply 'update-1.5.sql' script) 148 | - changed/added files: lib_intertext.php, aligner.php, cli/import, cli/align, css/intertext.css, 149 | icons/swap.png 150 | - (optional changes: help.php, help_cs.php, settings.php) 151 | 152 | Features: 153 | - English translation of the "user guide" (help.php), the Czech text is in 'help_cs.php' 154 | - imported texts remember their original filenames => imported alignment can identify 155 | the texts by their original filenames and not just the internal 'text name' and 'version name' 156 | - swap sides/versions in alignment (for admin) 157 | - import with 'cli/align' in the reverse direction 158 | - the supervisor (responsible) is now also allowed to edit alignment all the time (settings.php) 159 | 160 | Fixes: 161 | - searching bookmarks searched in all alignments of the given text (lib_intertext) 162 | 163 | Release 1.4 164 | ----------- 165 | - initial public release 166 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | ========================= 2 | INSTALLATION INSTRUCTIONS 3 | ========================= 4 | 5 | Overview: 6 | 7 | 1) Check requirements. 8 | 2) Copy all files into a web-server accessible directory. 9 | 3) Set-up MySQL. 10 | 4) Check installation of automatic aligners. 11 | 5) Check config/config.php and adjust to your needs. 12 | 6) Read user documentation (help.php) and run the CLI scripts (in 'cli/' 13 | directory) to get more informatiomn on their usage 14 | 7) [optional] Check and adapt trigger scripts in 'triggers/' directory. 15 | 16 | 17 | Ad 1) REQUIREMENTS 18 | ------------------ 19 | 20 | - A web server (tested with Apache 2.2) with PHP >= 5.2 support (older versions 21 | might work well, but were not tested) 22 | - PHP CLI support for CLI tools 23 | - PHP support (modules) for: XMLReader, JSON. 24 | - if you want to import XML files with external DTDs (needed for declaration of 25 | entities, etc.), you need to allow the option "allow_url_fopen" in php.ini for 26 | both Apache web-server and the CLI version of PHP 27 | - MySQL v5.6 or higher for fulltext search support; for older versions you must 28 | turn off fulltext searches explicitly by inserting '$DISABLE_FULLTEXT = true;' 29 | into your config.php 30 | 31 | 32 | Ad 2) Copy files to you web-server directory 33 | -------------------------------------------- 34 | 35 | Ensure the symbolic link from index.php to aligner.php is there. 'aligner.php' 36 | is the main script that should be run. 37 | 38 | Ad 3) Set-up MySQL 39 | ------------------ 40 | 41 | - it is highly suggested to use the option innodb_file_per_table in your 42 | MySQL configuration (usually in /etc/mysql/my.cnf, see the database 43 | documentation) 44 | - ensure that you have no upper size limit set for the main tablespace 45 | in innodb_data_file_path and that you have enough space available on your disk 46 | - [optional] if you want to use the MySQL fulltext search capability to search 47 | for words shorter than 4 characters in the texts, you have to adjust the 48 | configuration of MySQL before creating the database / indices (or rebuild the 49 | indices) by setting "ft_min_word_len = 3" and innodb_ft_min_token_size if you 50 | want to set it to even less characters - see MySQL documentation for more details 51 | - create basic database from intertext.sql script and create a user with full 52 | access to the database (or uncomment the default GRANT command in the script to 53 | create the default user) 54 | - if you do not have a database of users, create the table of default users from 55 | users.sql (InterText does not include its own management of users! but you can 56 | use any other system using MySQL database) - there are three default users 57 | created by users.sql: 'admin', 'resp' and 'editor', all with the default 58 | password 'test'; they represent the default three levels of users supported by 59 | InterText (see below for details) 60 | - set up the database connection parameters for the database of texts (and the 61 | database of users, if you made it a separate database) in config/config.php 62 | 63 | Explanation of the system of users in the InterText system: 64 | 65 | There are three levels of users in the workflow of the InterCorp project: 66 | 67 | - 'administrators' have all rights; it is the main project coordinator(s) who 68 | prepare texts for further processing, convert them into valid XML files and 69 | import them into the InterText system 70 | - 'supervisors (responsibles)' are people with (almost) full access to single 71 | texts assigned to them by the administrator or another 'responsible' users; in 72 | the InterCorp project, they are coordinators of language sections and supply the 73 | raw texts to the administrators, who prepare them for further processing in 74 | InterText; they can then assign the alignments (which they are responsible for) 75 | to particular editors or to each other and should check the quality of the results 76 | - 'editors' are users-workers (often students), who only can edit alignments 77 | assigned to them by higher level users 78 | 79 | The finer control over access rights can be modified by rewriting appropriate 80 | parts in config/default_permissions.php. See there for comments. 81 | 82 | 83 | Ad 4) Installation of automatic aligners 84 | ---------------------------------------- 85 | 86 | There are currently two supported automatic aligners: 87 | 88 | HUNALIGN (http://mokk.bme.hu/resources/hunalign): 89 | - you need to have a working binary 'hunalign' in the hunalign/ directory 90 | - there must be at least one default dictionary for hunalign, by default there 91 | is the empty dictionary _none_.dic 92 | - you can add as many dictionaries as you will, they will appear in InterText as 93 | different profiles for hunalign (the filename will be used without the .dic 94 | extension) 95 | - if you want to add pre-processing to the alignment process (e.g. 96 | lemmatization), you have to supply the processing into the process.sh script 97 | (see comments in the process.sh script for details) 98 | 99 | TCA2 (http://gandalf.aksis.uib.no/tca2/): 100 | - place the jar archive with the command-line version (not the GUI version!) of 101 | TCA2 into the tca2/ directory; it has to be called tca2.jar 102 | - you need a working java 1.6 VM in your system (or whatever you version 103 | requires) 104 | - you need profiles for each pair of languages - each profile consists of a pair 105 | of configuration file (.cfg) and a dictionary file (.dic) with otherwise 106 | identical filenames (see enclosed files for examples) 107 | 108 | You do not need any automatic aligner, but it can save you a lot of manual work 109 | by preparing an alignment that you only check and correct manually. By default, 110 | InterText itself can only 'align' the sentences 'one-to-one' (the method called 111 | 'plain alignment' in the system, its results have also visually lower status 112 | than results from the automatic aligners). 113 | 114 | 115 | Ad 5) configuration 116 | ------------------ 117 | 118 | The files in the config/ directory are the first files which get processed 119 | at every request. You can modify the default settings and permissions here. 120 | The config.php file contains the very basic settings and defaults. 121 | Read the file comments for further details. 122 | 123 | You have to set up the database connections for the database of texts and the 124 | database of users in the config/config.php file. 125 | 126 | For the database of users, you can supply your own name of the table of users 127 | and the names of columns with the username, password, user-level, first name and 128 | surname of the users. (The password should be encoded by md5sum.) You can also 129 | define which values of your user-level column correspond to which user level in 130 | the InterText system. 131 | 132 | By modifying the set_alignment_settings function in config/default_permissions.php, 133 | you can change the system of permissions for single texts, alignments and users. 134 | 135 | Ad 7) The triggers 136 | ------------------ 137 | 138 | The 'triggers/' directory contains scripts, which are run every time the status 139 | of some alignment is changed. The scripts can be any executable files with the 140 | appropriate names. The names are 'alstat_open', 'alstat_finished', 141 | 'alstat_closed' and 'alstat_blocked' for the 'open', 'finished', 'closed' and 142 | 'blocked' status. The most probable use will be for the "closed" (or "finished") 143 | script, which can e.g. export files from InterText, upload them to your corpus 144 | manager, update your database of completed texts, do accounting of payments to 145 | the editor / coordinator, etc. 146 | 147 | See for comments in the example scripts with details on arguments sent to the 148 | script. 149 | 150 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | *************************************************************************** 2 | Copyright (c) 2010-2017 Pavel Vondřička (Pavel.Vondricka@korpus.cz) 3 | Copyright (c) 2010-2017 Charles University in Prague, Faculty of Arts, 4 | Institute of the Czech National Corpus 5 | *************************************************************************** 6 | 7 | This package contains InterText Server. 8 | 9 | InterText Server is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | InterText Server is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with InterText Server. If not, see . 21 | 22 | *************************************************************************** 23 | 24 | The subdirectory "icons" contains files from the KDE project Oxygen 25 | (http://www.kde.org/) licensed under LGPL v3. See icons/LICENSE 26 | for details. 27 | 28 | *************************************************************************** 29 | 30 | InterText Server uses additional third-party javascript libraries licensed 31 | under their own licenses as provided in their code: 32 | 33 | jQuery: 34 | - js/jquery-1.3.2.min.js 35 | - js/ui.core.js 36 | - js/ui.progressbar.js 37 | - css/cupertino/ (all contents within this directory and its subdirectories) 38 | 39 | JEIP: 40 | - js/jeip.js 41 | 42 | JXS: 43 | - js/jxs.js 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # InterText Server 2 | 3 | InterText is an on-line editor for aligned parallel texts. It was developed for 4 | the project [InterCorp](http://www.korpus.cz/intercorp/?lang=en) to edit and 5 | manage alignments of multiple parallel language versions of texts at the level 6 | of sentences, but it is designed with flexibility in mind and supports custom 7 | XML documents and Unicode character set. The software is written in PHP and uses 8 | MySQL database as back-end. 9 | 10 | _InterText Server_ is the original server based implementation with web-based interface, using PHP a MySQL database. It is designed for management of large, collaborative projects with many users, and - unlike the personal desktop application called _Intertext Editor_ - its installation and deployment requires at least some basic skills of server administrator. 11 | 12 | See the [InterText project homepage](http://wanthalf.saga.cz/intertext) for more details. 13 | 14 | ## Features 15 | 16 | - can manage any number of texts 17 | - can manage any number of text (language) versions for each text 18 | - import and export of any valid XML document (see LIMITATIONS & KNOWN ISSUES!) 19 | - support of unicode (UTF-8) by default 20 | - automatic conversion of custom entities into UTF-8 characters on import 21 | - arbitrary alignments between any pair of (language) versions of the same text 22 | - one level alignment, every text version can define its own XML elements 23 | containing text to be aligned 24 | - integration of the 'hunalign' and 'TCA2' automatic aligners 25 | - import and export of alignments in TEI XML format (stand-off alignment, no 26 | conversion, see below for details) 27 | - opt. export of documents with 'corresp' attributes on aligned elements 28 | - opt. export of documents with text segments enclosed in elements (for 29 | ParaConc compatibility) 30 | - possibility to edit text on-the-fly when editing alignments (can be forbidden 31 | on per-text basis) 32 | - keeps history of all changes to the text for later revision 33 | - possibility to change segmentation of elements (e.g. sentences) by splitting 34 | or merging them in the alignment editor (can be forbidden on per-text basis) 35 | - possibility to split or merge container (parent) elements (e.g. paragraphs) 36 | - separate possibility to prevent the change of segmentation (structure) for 37 | 'pivot' text versions 38 | - automatic (one- or two-level) re-numbering of text elements after change in 39 | segmentation (structure) 40 | - possibility to set bookmarks in the alignment and jump quickly between them 41 | - possibility to search for substrings, fulltext search and regular expression 42 | based search in the texts (as limited by the MySQL-engine capabilities), search 43 | for "suspicious" alignments and edited/changed elements, etc. 44 | - basic workflow management based on three-level user hierarchy (only basic user 45 | management, uses external database of users) and three-(four)-level status of 46 | alignments 47 | - command-line access to the import and export functions for batch-processing 48 | - triggers for external scripts on the change of alignment status 49 | - synchronization of texts and alignments with external InterText editor clients 50 | 51 | 52 | ## Technical details on file formats 53 | 54 | - the system expects use of id-attributes with (at most) two-part numbers (two levels) for all 55 | alignable elements, the separator can be any of : , . - _ characters; their 56 | parent elements can be numbered by simple numbers only; prefixes to the 57 | id-attributes are possible, but they will be stripped on import (and can be 58 | regenerated on export as "long-ids" by the corresponding function in 59 | config/export_customization.php 60 | - the default (re-)numbering scheme is to have simple numbers for containers 61 | (parents) and two-part numbers for alignable elements, separated by a colon 62 | (e.g. "12:3" for the third sentence (element) in the 12th paragraph (container)) 63 | - if nested containers are detected in the document, only simple (single level) 64 | numbering of the alignable elements is applied and their parents (containers) 65 | are ignored 66 | - the file format for TEI alignment file is one single "linkGrp" element with 67 | two attributes: "toDoc" and "fromDoc"; their values should point to the 68 | filenames of the separate documents, or at least have the form: 69 | "document_name.version_name.extensions" - extensions are optional, but 70 | "document_name" and "version_name" are used to identify the aligned document 71 | versions of this alignment according to the names as declared in InterText; 72 | the "linkGrp" element then contains the "link" elements, each corresponding 73 | to one position (segment) in the alignment, with the following attributes: 74 | - "xtargets" is a semicolon separated list of element's id-values linked 75 | together (first a space-separated list of element id-s from the "toDoc" 76 | document, and after the semicolon a space-separated list of element id-s 77 | from the "fromDoc" document); 78 | - "status" is an optional attribute with the status of the link - known values 79 | are "man" (for manually confirmed link), "auto" (for automatically aligned 80 | elements), "plain" (for unaligned / unconfirmed / uknown status); 81 | - "mark" is used internally to preserve user bookmarks from the editor, only 82 | values 0 and 1 are known, but for 0 no attribute is generated at all on export 83 | - "type" is only generated on export for convenience, it gives a dash 84 | separated count of elements linked together by the link (e.g. "1-2") 85 | 86 | 87 | ## LIMITATIONS & KNOWN ISSUES 88 | 89 | - the package does not contain the Hunalign nor the TCA2 automatic aligners 90 | - DOCTYPE, entity definitions and the XML declaration element are not imported 91 | (preserved) from the XML file (a problem of the PHP XMLReader module); the only 92 | preserved node types are: elements with their attributes (see below for 93 | exception!), text and CDATA contents, comments, processing instructions and 94 | whitespace formatting (CDATA not tested); you can (as a workaround) add your own 95 | DOCTYPE on export or otherwise modify the exported XML header by modification of 96 | the corresponding function in config/export_customization.php 97 | - the PHP XMLReader module is obscure in many ways and its behaviour changes 98 | in different versions of PHP; it is highly suggested to validate every document 99 | by a separate XML validator before import into InterText - the validation officially 100 | supported by the XMLReader behaves unpredictably and erratically, if it works at all; 101 | in case of further issues, remove any DOCTYPE as well 102 | - the "id" attributes of elements are parsed and only final numbers are 103 | extracted: two-part numbers for alignable elements (e.g. "12:3") and single 104 | numbers for the other elements; the alignable elements and their parents 105 | (containers) get renumbered when the document structure is changed in the 106 | editor; in the two-level numbering mode, any other elements will just lose their 107 | id-attributes (i.e. will be cut down to any final numbers like the containers, 108 | if there were any); long id-attributes (and other id-s) can be (as a workaround) 109 | restored/re-created on export by the corresponding function defined in 110 | config/export_customization.php; by configuring InterText to use single-level 111 | numbering of elements exclusively, the IDs of elements (except of the alignable ones) 112 | can be kept, however! 113 | - some versions of "hunalign" are known to fail (segmentation fault) 114 | with texts larger than ca. 30000 elements (this is not a problem of InterText) 115 | 116 | 117 | ## For more information read... 118 | 119 | - INSTALL - installation instructions, set-up, customization and other 120 | administration-related information 121 | - UPDATE.txt - instructions for update 122 | - help.php - user-manual, including details on the functions and principles of 123 | the system 124 | - CHANGELOG - list of changes (added features and fixed bugs) 125 | 126 | For the very basic principles and problems of parallel text alignment, you may also refer to the manual of the _InterText Editor_, available (a.o.) from the [project homepage](http://wanthalf.saga.cz/intertext). 127 | 128 | ## Acknowledgement: 129 | 130 | This software and documentation was partly supported from the implementation of the Czech National Corpus project (LM2011023) funded by the _Ministry of Education, Youth and Sports_ of the Czech republic within the framework of _Large Research, Development and Innovation Infrastructures_. 131 | 132 | ## License: 133 | 134 | This software is licensed under the GNU General Public License v3. (http://www.gnu.org/licenses/gpl-3.0.html) 135 | 136 | - Copyright (c) 2010-2017 Pavel Vondřička 137 | - Copyright (c) 2010-2017 Charles University in Prague, Faculty of Arts, Institute of the Czech National Corpus 138 | 139 | -------------------------------------------------------------------------------- /UPDATE.txt: -------------------------------------------------------------------------------- 1 | -> version 2.3 2 | ============== 3 | 4 | - the configuration file settings.php has been replaced and split into the files: 5 | init.php 6 | config/config.php 7 | config/default_permissions.php 8 | config/export_customization.php 9 | config/login_handler.php 10 | (you need to move your configuration settings into the appropriate files; in most 11 | cases this will only concern the settings in the config/config.php file) 12 | 13 | -> version 2.2 14 | ============== 15 | 16 | - you need EITHER to have MySQL version >= 5.6 OR to turn off fulltext searches 17 | explicitly by inserting '$DISABLE_FULLTEXT = true;' into your config.php - 18 | this must be decided/solved FIRST OF ALL! 19 | - it is highly suggested to use the option innodb_file_per_table in your 20 | MySQL configuration (usually in /etc/mysql/my.cnf, see the database 21 | documentation) 22 | - ensure that you have no upper size limit set for the main tablespace 23 | in innodb_data_file_path and that you have enough space available on your disk; 24 | the file may grow by several gigabytes even when using 25 | innodb_file_per_table and if it hits a size limit, you may get into troubles with 26 | the conversion process (below); the database will also grow significantly in 27 | size after conversion 28 | - in order to make the new transaction support effective on existing data, 29 | you need to run the script 'update-2.2.php', which will convert all 30 | existing tables into the InnoDB format (and remove fulltext indexes if 31 | fulltext is disabled in config.php) - this conversion is NOT neccessary for 32 | InterText to run, but until you convert the tables, the transactions will 33 | silently be ineffective for all texts existing before the update 34 | (and even for newly added translations of those texts!) - this conversion should 35 | in theory be safe to do on a running system, but making back-ups before any 36 | change is always highly recommended! 37 | 38 | version 1.7 -> version 2.0 39 | ========================== 40 | - before updating, the database must be updated by running the 41 | 'update-2.0.php' script 42 | - new options need to be added to settings.php 43 | 44 | version 1.4 -> version 1.5 45 | ========================== 46 | - before updating, the database must be updated by running the 47 | 'update-1.5.sql' script in MySQL 48 | - additional changes in settings.php may apply 49 | -------------------------------------------------------------------------------- /alignment.php: -------------------------------------------------------------------------------- 1 | . 20 | * 21 | */ 22 | 23 | set_time_limit(9999); 24 | require 'init.php'; 25 | require 'lib_intertext.php'; 26 | $system = new InterText; 27 | 28 | print "Process: Creating alignment...\nProgress: 0\n"; flush(); ob_flush(); 29 | if ($_SESSION['realign']) { 30 | $res = $aid = $_COOKIE['InterText_aid']; 31 | } else { 32 | #$v1 = $system->txtver_by_id($_COOKIE['InterText_txt'],$_SESSION['al_ver1']); 33 | #$v2 = $system->txtver_by_id($_COOKIE['InterText_txt'],$_SESSION['al_ver2']); 34 | #$aid = $system->insert_alignment($v1['text_id'],$v1['id'],$v2['id'],$_SESSION['al_method'],$_SESSION['al_profile'],$USER['id']); 35 | $aid = $system->insert_alignment($_COOKIE['InterText_txt'],$_SESSION['al_ver1'],$_SESSION['al_ver2'],$_SESSION['al_method'],$_SESSION['al_profile'],$USER['id'],0,$DEFAULT_EDIT_PERMISSION); 36 | $defstat = $_SESSION['al_default_status']; 37 | $res = $aid; 38 | } 39 | 40 | if (!$res) { print "Process: Creating alignment...
ERROR: These versions have already an open alignment!\n\n"; flush(); ob_flush(); } 41 | else { 42 | # Import alignment from file, if any 43 | if ($res AND $_SESSION['al_file']!='') 44 | $res = $system->import_alignment($_SESSION['al_file'],$aid,$defstat,TRUE,FALSE); 45 | 46 | if ($res) { 47 | # Run automatic aligner as requested 48 | switch ($_SESSION['al_method']) { 49 | case "tca2": 50 | $res = $system->autoalign_tca2($aid,$_SESSION['al_profile']); 51 | break; 52 | case "hunalign": 53 | $res = $system->autoalign_hunalign($aid,$_SESSION['al_profile']); 54 | break; 55 | default: 56 | $res = $system->plain_alignment($aid); 57 | } 58 | } 59 | 60 | # Create plain alignment for the rest 61 | #if ($res) $system->plain_alignment($aid); 62 | 63 | # In case of failure... 64 | if (!$res) { 65 | if (!$_SESSION['realign']) $system->delete_alignment($aid); 66 | } else print "Process: Finished.\n"; 67 | } 68 | 69 | if ($_SESSION['al_file']!='') unlink($_SESSION['al_file']); 70 | unset($_SESSION['realign']); 71 | unset($_SESSION['al_file']); 72 | unset($_SESSION['al_ver1']); 73 | unset($_SESSION['al_ver2']); 74 | unset($_SESSION['al_method']); 75 | unset($_SESSION['al_profile']); 76 | unset($_SESSION['al_default_status']); 77 | 78 | ?> 79 | -------------------------------------------------------------------------------- /cli/.htaccess: -------------------------------------------------------------------------------- 1 | Deny from all 2 | 3 | -------------------------------------------------------------------------------- /cli/align: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | . 21 | * 22 | */ 23 | 24 | $CLI_MODE = true; 25 | $pwd = preg_replace('/[^\/]*$/','',$_SERVER['PATH_TRANSLATED']); 26 | require $pwd.'/../init.php'; 27 | require $pwd.'/../lib_intertext.php'; 28 | 29 | $edit = $DEFAULT_EDIT_PERMISSION; 30 | $method = $DEFAULT_METHOD; 31 | $profile = $DEFAULT_PROFILE; 32 | $defstat = 1; 33 | $verbose = false; 34 | $resp = 0; 35 | $editor = 0; 36 | $swap = false; 37 | $force = false; 38 | 39 | array_shift($argv); 40 | while ($arg = array_shift($argv)) { 41 | switch ($arg) { 42 | case '-i': 43 | $filename = array_shift($argv); 44 | break; 45 | case '-m': 46 | $method = array_shift($argv); 47 | $profile = ''; 48 | list($method,$profile) = explode(':',$method,2); 49 | break; 50 | case '-r': 51 | $resp = array_shift($argv); 52 | break; 53 | case '-d': 54 | $defstat = array_shift($argv); 55 | break; 56 | case '-e': 57 | $editor = array_shift($argv); 58 | break; 59 | case '-c_chstruct': 60 | $c_chstruct = 1; 61 | break; 62 | case '-edit': 63 | $edit = 1; 64 | break; 65 | case '-noedit': 66 | $edit = 0; 67 | break; 68 | case '-swap': 69 | $swap = true; 70 | break; 71 | case '-v': 72 | $verbose = true; 73 | break; 74 | case '-f': 75 | $force = true; 76 | break; 77 | case '-s': 78 | $status = array_shift($argv); 79 | break; 80 | default: 81 | if (substr($arg,0,1)=='-') { 82 | print "Error: Unknow option '$arg'.\n"; exit; 83 | } elseif ($tname=='') $tname = $arg; 84 | elseif ($ver1=='') $ver1 = $arg; 85 | elseif ($ver2=='') $ver2 = $arg; 86 | else $fail=true; 87 | } 88 | } 89 | 90 | $statusdata = "1=manual, 2=automatic, 3=plain"; 91 | 92 | if (($filename=='' && ($tname=='' || $ver1=='' || $ver2=='')) || $fail) { 93 | print "InterText CLI alignment utility 94 | =============================== 95 | Tool to import and/or generate alignment between two different versions of one text in the InterText system. 96 | 97 | Usage: 98 | 99 | align [options] 100 | align [options] -i 101 | 102 | Options: 103 | 104 | -i 105 | import initial alignment from file 106 | 107 | -swap 108 | swap sides/versions when importing from file (option -i) 109 | 110 | -d 111 | default status for imported alignment links with unknown status: 112 | $statusdata (default: manual) 113 | 114 | -m [:] 115 | specify method (and profile) for authomatic alignment, currently 116 | available mathods: plain, tca2, hunalign (default: by config/config.php, currently: '$DEFAULT_METHOD:$DEFAULT_PROFILE') 117 | 118 | -r 119 | set user-id of the user responsible for the alignment (default: '0' = nobody) 120 | 121 | -e 122 | set user-id of alignment editor (default: '0' = nobody) 123 | 124 | -c_chstruct 125 | enable permission to change structure of the central text version (default: disabled) 126 | 127 | -edit 128 | enable permission to edit the texts (default: by config/config.php, currently: '$DEFAULT_EDIT_PERMISSION') 129 | 130 | -noedit 131 | disable permission to edit the text (default: by config/config.php, currently: '$DEFAULT_EDIT_PERMISSION') 132 | 133 | -s 134 | set status for the alignment, possible values: open, finished, closed, blocked (default: open) 135 | 136 | -f 137 | force delete if alignment already exists 138 | 139 | -v 140 | verbose output (show progress) 141 | =============================== 142 | "; 143 | exit; 144 | } 145 | 146 | $it = new InterText; 147 | if ($tname!='' && $ver1!='' && $ver2!='') { 148 | if (!($txtid=$it->text_id_by_name($tname))) die("Error: Text '$tname' not found in database.\n"); 149 | $v1 = $it->txtver_info($txtid,$ver1); 150 | if (!$v1) die("Error: Version '$ver1' not found in database.\n"); 151 | $v2 = $it->txtver_info($txtid,$ver2); 152 | if (!$v2) die("Error: Version '$ver2' not found in database.\n"); 153 | $aid = $it->insert_alignment($txtid,$v1['id'],$v2['id'],$method,$profile,$resp,$editor,$edit); 154 | if ($aid) 155 | $res = true; 156 | else { 157 | if ($force) { 158 | $al = $it->get_alignment_by_name($tname,$ver1,$ver2); 159 | //if (!$al) $al = $it->get_alignment_by_name($tname,$ver2,$ver1); 160 | $aid = $al['id']; 161 | $it->delete_alignment($aid); 162 | $aid = $it->insert_alignment($txtid,$v1['id'],$v2['id'],$method,$profile,$resp,$editor,$edit); 163 | $res = true; 164 | } else 165 | die("Error: Such alignment already exists.\n"); 166 | } 167 | } else $aid = FALSE; 168 | 169 | if ($filename && $filename!='') { 170 | $res = $it->import_alignment($filename,$aid,$defstat,$verbose,FALSE,$method,$profile,$resp,$editor,$edit,$swap); 171 | if ($res) $aid = $res; 172 | } 173 | 174 | if ($res) { 175 | # Run automatic aligner as requested 176 | switch ($method) { 177 | case "tca2": 178 | $res = $it->autoalign_tca2($aid,$profile,$verbose); 179 | break; 180 | case "hunalign": 181 | $res = $it->autoalign_hunalign($aid,$profile,$verbose); 182 | break; 183 | default: 184 | $res = $system->plain_alignment($aid); 185 | } 186 | } 187 | 188 | # In case of failure... 189 | if (!$res) { 190 | if ($aid) $it->delete_alignment($aid); 191 | if ($_ERROR=='') $_ERROR = 'Error while creating alignment. Turn on verbose mode (-v) for more information.'; 192 | print $_ERROR."\n"; 193 | return 1; 194 | } else { 195 | if ($c_chstruct) $it->alignment_chcstruct($aid,$c_chstruct); 196 | if ($status!='') { 197 | //if ($status=='closed') $res=$it->alignment_chstat($aid,ALSTAT_FINISHED); 198 | if ($res) { 199 | $stat = array_search($status,$ALSTAT); 200 | if ($stat) $res=$it->alignment_chstat($aid,$stat); 201 | else print "Error setting status: Unknown status '$status'.\n"; 202 | } 203 | if (!$res) print "Error setting status: $_ERROR\n"; 204 | } 205 | } 206 | 207 | return 0; 208 | 209 | ?> 210 | -------------------------------------------------------------------------------- /cli/export: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | . 21 | * 22 | */ 23 | 24 | $CLI_MODE = true; 25 | $tname=''; 26 | $skipempty = false; 27 | 28 | array_shift($argv); 29 | while ($arg = array_shift($argv)) { 30 | switch ($arg) { 31 | case '-se': 32 | $skipempty = true; 33 | break; 34 | case '-f': 35 | $format = array_shift($argv); 36 | break; 37 | case '-tname': 38 | $tname = array_shift($argv); 39 | break; 40 | case 'aid': 41 | $mode = 'aid'; 42 | $aid = array_shift($argv); 43 | if ($format=='') $format='xml'; 44 | break; 45 | case 't1aid': 46 | $mode = 't1aid'; 47 | $aid = array_shift($argv); 48 | if ($format=='') $format='xml'; 49 | break; 50 | case 't2aid': 51 | $mode = 't2aid'; 52 | $aid = array_shift($argv); 53 | if ($format=='') $format='xml'; 54 | break; 55 | case 'aname': 56 | $mode = 'aname'; 57 | $tname = array_shift($argv); 58 | $v1name = array_shift($argv); 59 | $v2name = array_shift($argv); 60 | if ($format=='') $format='xml'; 61 | break; 62 | case 'tname': 63 | $mode = 'tname'; 64 | $tname = array_shift($argv); 65 | $vname = array_shift($argv); 66 | if ($format=='') $format='xml'; 67 | break; 68 | case 'all_closed': 69 | $mode = 'all_closed'; 70 | if ($format=='') $format='xml'; 71 | break; 72 | } 73 | } 74 | 75 | $pwd = preg_replace('/[^\/]*$/','',$_SERVER['PATH_TRANSLATED']); 76 | require $pwd.'/../init.php'; 77 | require $pwd.'/../lib_intertext.php'; 78 | 79 | if ($mode=='' || ($mode=='aname' && ($tname=='' || $v1name=='' || $v2name=='')) || ($mode=='tname' && ($tname=='' || $vname=='')) || (substr($mode,-3)=='aid' && $aid=='')) { 80 | print "InterText CLI export utility 81 | ============================ 82 | Tool to export alignments and texts from the InterText system. 83 | 84 | Usage: 85 | 86 | export [options] aid 87 | export [options] aname 88 | export [options] t1aid 89 | export [options] t2aid 90 | export [options] tname 91 | export [options] all_closed 92 | 93 | Options: 94 | 95 | -f 96 | format of the output 97 | for alignments: 98 | xml - XML TEI file with links (plain IDs) [default] 99 | xml:ic - XML TEI file with links (long IDs for project InterCorp) 100 | xml:fn - XML TEI file with links (long filename-based IDs for project ECPC) 101 | for texts: 102 | xml - original XML file (plain IDs) [default] 103 | xml:ic - original XML file (long IDs for project InterCorp) 104 | xml:fn - original XML file (long filename-based IDs for project ECPC) 105 | corresp - original XML file with added 'corresp' attributes on text elements, 106 | linking the corresponding element IDs from the other version 107 | (cannot be used in 'tname' mode) 108 | segs - XML file with ments (ParaConc format) 109 | 110 | -se 111 | skip empty segments in alignment export 112 | 113 | for all_closed: 114 | -tname 115 | export only alignments of the given text 116 | 117 | Examples: 118 | 119 | - export alignment id 34 120 | 121 | export aid 34 122 | 123 | - export alignment of text 'Document1', versions 'english' and 'french' 124 | 125 | export aname Document1 english french 126 | 127 | - export second text version of alignment id 34 128 | 129 | export t2aid 34 130 | 131 | - export text version 'english' of 'Document1' 132 | 133 | export tname Document1 english 134 | 135 | - export all closed alignments with the texts into the current directory 136 | 137 | export all_closed 138 | 139 | ============================ 140 | "; 141 | exit; 142 | } 143 | 144 | $it = new InterText; 145 | $res = false; 146 | 147 | switch ($mode) { 148 | case 'aid': 149 | $res = $it->export_alignment($aid,$format,$skipempty); 150 | break; 151 | case 'aname': 152 | $al = $it->get_alignment_by_name($tname,$v1name,$v2name); 153 | if (!$al) $al = $it->get_alignment_by_name($tname,$v2name,$v1name); 154 | if ($al) $res = $it->export_alignment($al['id'],$format,$skipempty); 155 | break; 156 | case 't1aid': 157 | $al = $it->alignment_info($aid); 158 | if (!$al) break; 159 | $res = $it->export_document($al['text_id'],$al['ver1_id'],$aid,$format); 160 | break; 161 | case 't2aid': 162 | $al = $it->alignment_info($aid); 163 | if (!$al) break; 164 | $res = $it->export_document($al['text_id'],$al['ver2_id'],$aid,$format); 165 | break; 166 | case 'tname': 167 | $tid = $it->text_id_by_name($tname); 168 | if (!$tid) { $_ERROR = "Error: Text not found."; break; } 169 | $ver = $it->txtver_info($tid,$vname); 170 | if (!$ver) { $_ERROR = "Error: Version not found."; break; } 171 | $res = $it->export_document($tid,$ver['id'],0,$format); 172 | break; 173 | case 'all_closed': 174 | $list = $it->get_alignments_by_status(ALSTAT_CLOSED,$tname); 175 | foreach ($list as $al) { 176 | $alname = $al['text_name'].'.'.$al['v1_name'].'.'.$al['v2_name'].'.alignment.xml'; 177 | $v1name = $al['text_name'].'.'.$al['v1_name'].'.xml'; 178 | $v2name = $al['text_name'].'.'.$al['v2_name'].'.xml'; 179 | print $alname; 180 | if (!file_exists($alname)) { 181 | $res = $it->export_alignment($al['id'],$format,$skipempty); 182 | if (!$res) print ' - export failed: '.$_ERROR."\n"; 183 | else { 184 | if (file_put_contents($alname,$res)) print "\n"; 185 | else print " - cannot save file!\n"; 186 | } 187 | } else print " - file already exists!\n"; 188 | print $v1name; 189 | if (!file_exists($v1name)) { 190 | $res = $it->export_document($al['text_id'],$al['v1_id'],$al['id'],$format); 191 | if (!$res) print ' - export failed: '.$_ERROR."\n"; 192 | else { 193 | if (file_put_contents($v1name,$res)) print "\n"; 194 | else print " - cannot save file!\n"; 195 | } 196 | } else print " - file already exists!\n"; 197 | print $v2name; 198 | if (!file_exists($v2name)) { 199 | $res = $it->export_document($al['text_id'],$al['v2_id'],$al['id'],$format); 200 | if (!$res) print ' - export failed: '.$_ERROR."\n"; 201 | else { 202 | if (file_put_contents($v2name,$res)) print "\n"; 203 | else print " - cannot save file!\n"; 204 | } 205 | } else print " - file already exists!\n"; 206 | } 207 | $res = ''; 208 | break; 209 | } 210 | 211 | if (!$res) { 212 | $stderr = fopen('php://stderr', 'w'); 213 | fwrite($stderr,$_ERROR."\n"); 214 | fclose($stderr); 215 | return 1; 216 | } else { 217 | print $res; 218 | return 0; 219 | } 220 | ?> 221 | -------------------------------------------------------------------------------- /cli/import: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | . 21 | * 22 | */ 23 | 24 | $CLI_MODE = true; 25 | $filename=''; 26 | $validate = false; 27 | 28 | array_shift($argv); 29 | while ($arg = array_shift($argv)) { 30 | switch ($arg) { 31 | case '-e': 32 | $myelements = array_shift($argv); 33 | break; 34 | case '-n': 35 | $mydocname = array_shift($argv); 36 | break; 37 | case '-v': 38 | $myversion = array_shift($argv); 39 | break; 40 | case '--validate': 41 | $validate = true; 42 | break; 43 | case 'align': 44 | $ver2 = array_shift($argv); 45 | $alopts = array(); 46 | while ($opt = array_shift($argv)) $alopts[] = $opt; 47 | $aloptions = join(' ',$alopts); 48 | break; 49 | case 'align1': 50 | $ver1 = array_shift($argv); 51 | $alopts = array(); 52 | while ($opt = array_shift($argv)) $alopts[] = $opt; 53 | $aloptions = join(' ',$alopts); 54 | break; 55 | default: 56 | if (substr($arg,0,1)=='-') { 57 | print "Error: Unknow option '$arg'.\n"; exit; 58 | } elseif ($filename=='') $filename = $arg; 59 | else $fail=true; 60 | } 61 | } 62 | 63 | $pwd = preg_replace('/[^\/]*$/','',$_SERVER['PATH_TRANSLATED']); 64 | require $pwd.'/../init.php'; 65 | require $pwd.'/../lib_intertext.php'; 66 | 67 | $p = explode('/',$filename); 68 | $docname = $p[count($p)-1]; 69 | list($docname,$version,$ext) = explode('.',$docname,3); 70 | if ($mydocname!='') $docname = $mydocname; 71 | if ($myversion!='') $version = $myversion; 72 | if ($myelements!='') $elements = strtr($myelements,',',' '); 73 | else $elements = $DEFAULT_TEXT_ELEMENTS; 74 | 75 | 76 | if ($filename=='' || $docname=='' || $version=='' || $fail) { 77 | print "InterText CLI import utility 78 | ============================ 79 | Tool to import text versions into the InterText system and import or generate alignments between them. 80 | 81 | Usage: 82 | 83 | import [options] [align [alignment_options]] 84 | import [options] [align1 [alignment_options]] 85 | 86 | Filename format: 87 | 88 | .. 89 | 90 | Options: 91 | 92 | -e 93 | comma separated list of names of XML elements containing alignable text (e.g. '-e head,s,verse') 94 | 95 | -n 96 | text name (overrides the text name acquired from the filename) 97 | 98 | -v 99 | text version (overrides the version name acquired from filename) 100 | 101 | --validate 102 | force DTD validation 103 | 104 | Align: 105 | Create alignment with version or after the import. The other version 106 | must already be present in the system. Alignment is created by calling the associated 'align' utility. 107 | 108 | Alignment options: 109 | See the 'align' script for options. 110 | 111 | Examples: 112 | 113 | - to import text 'Document1' version 'english' from file 'Document1.english.xml': 114 | 115 | import Document1.english.xml 116 | 117 | - to import text 'Document1' version 'english' from file 'd1_en.xml': 118 | 119 | import -n Document1 -v english d1_en.xml 120 | 121 | - to import 'Document1' version 'french' from file 'Document1.french.xml' and create 122 | automatic alignment with the version 'english' of the same document: 123 | 124 | import Document1.french.xml align english 125 | 126 | - to import 'Document1' version 'french' from the file 'Document1.french.xml' and create 127 | alignment with version 'english', imported from file 'Document1.en-fr_alignment.xml': 128 | 129 | import Document1.french.xml align english -i Document1.en-fr_alignment.xml 130 | ============================ 131 | "; 132 | exit; 133 | } 134 | 135 | $it = new InterText; 136 | $res = $it->import_document($docname,$version,$filename,$elements,true,$filename,$validate); 137 | if (!$res) { print $_ERROR."\n"; return 1; } 138 | elseif ($ver2!='') return system("$pwd/align $docname $version $ver2 $aloptions"); 139 | elseif ($ver1!='') return system("$pwd/align $docname $ver1 $version $aloptions"); 140 | else return 0; 141 | 142 | ?> 143 | -------------------------------------------------------------------------------- /cli/renumber: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | . 21 | * 22 | */ 23 | 24 | $CLI_MODE = true; 25 | $pwd = preg_replace('/[^\/]*$/','',$_SERVER['PATH_TRANSLATED']); 26 | require $pwd.'/../init.php'; 27 | require $pwd.'/../lib_intertext.php'; 28 | 29 | $verbose = false; 30 | $twolevel = true; 31 | $tname = ''; 32 | $vname = ''; 33 | 34 | array_shift($argv); 35 | while ($arg = array_shift($argv)) { 36 | switch ($arg) { 37 | case '-1': 38 | $twolevel = false; 39 | break; 40 | default: 41 | if (substr($arg,0,1)=='-') { 42 | print "Error: Unknow option '$arg'.\n"; exit; 43 | } elseif ($tname=='') $tname = $arg; 44 | elseif ($vname=='') $vname = $arg; 45 | else $fail=true; 46 | } 47 | } 48 | 49 | if (($tname=='' || $vname=='') || $fail) { 50 | print "InterText CLI renumbering utility 51 | ================================== 52 | Tool to renumber ID of the given text version in the InterText system. 53 | 54 | Usage: 55 | 56 | renumber [options] 57 | 58 | Options: 59 | 60 | -1 61 | single level numbering only 62 | 63 | =============================== 64 | "; 65 | exit; 66 | } 67 | 68 | $it = new InterText; 69 | if (!($txtid=$it->text_id_by_name($tname))) die("Error: Text '$tname' not found in database.\n"); 70 | $vid = $it->txtver_info($txtid,$vname); 71 | $vid = $vid['id']; 72 | if (!$vid) die("Error: Version '$vname' not found in database.\n"); 73 | 74 | 75 | $res = $it->update_eids($txtid, $vid, $twolevel); 76 | 77 | if ($res==1 && $twolevel) { 78 | print "Warning: Text renumbered, but only single level alignment was possible.\n"; 79 | } 80 | 81 | return 0; 82 | 83 | ?> 84 | -------------------------------------------------------------------------------- /cli/update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | . 21 | * 22 | */ 23 | 24 | $CLI_MODE = true; 25 | $userid = 0; 26 | 27 | array_shift($argv); 28 | while ($arg = array_shift($argv)) { 29 | switch ($arg) { 30 | case '-u': 31 | $userid = array_shift($argv); 32 | break; 33 | case '-n': 34 | $mydocname = array_shift($argv); 35 | break; 36 | case '-v': 37 | $myversion = array_shift($argv); 38 | break; 39 | default: 40 | if (substr($arg,0,1)=='-') { 41 | print "Error: Unknow option '$arg'.\n"; exit; 42 | } elseif ($filename=='') $filename = $arg; 43 | else $fail=true; 44 | } 45 | } 46 | 47 | $pwd = preg_replace('/[^\/]*$/','',$_SERVER['PATH_TRANSLATED']); 48 | require $pwd.'/../init.php'; 49 | require $pwd.'/../lib_intertext.php'; 50 | 51 | $p = explode('/',$filename); 52 | $docname = $p[count($p)-1]; 53 | list($docname,$version,$ext) = explode('.',$docname,3); 54 | if ($mydocname!='') $docname = $mydocname; 55 | if ($myversion!='') $version = $myversion; 56 | 57 | if ($filename=='' || $docname=='' || $version=='' || $fail) { 58 | print "InterText CLI update utility 59 | ============================ 60 | Tool to update text versions already present in the database. The given file 61 | will be compared with the database for each text element and in case of 62 | difference the database elements will be updated with the new text. The 63 | structure (and 'id' attributes) must be identical! If not, the script fails 64 | as soon as some ID is not found in the database. However, changes commited up 65 | to this point will NOT be revoked! (The changes are recorded in the changelog 66 | table, at least.) Backup your texts before updating them! 67 | 68 | The script will output a list of all changes done, including the ID and both 69 | the old and the new text of every changed element. 70 | 71 | Usage: 72 | 73 | update [options] 74 | 75 | Filename format: 76 | 77 | .. 78 | 79 | Options: 80 | 81 | -n 82 | text name (overrides the text name acquired from the filename) 83 | 84 | -v 85 | text version (overrides the version name acquired from filename) 86 | 87 | -u 88 | set user-id as the author of updates (default: '0' = nobody) 89 | 90 | ============================ 91 | "; 92 | exit; 93 | } 94 | 95 | $it = new InterText; 96 | $res = $it->update_document($docname,$version,$filename,$userid,true); 97 | if (!$res) { print $_ERROR."\n"; return 1; } 98 | else return 0; 99 | 100 | ?> 101 | -------------------------------------------------------------------------------- /config/config.php: -------------------------------------------------------------------------------- 1 | . 20 | * 21 | */ 22 | 23 | ### General defaults 24 | # set default timezone 25 | date_default_timezone_set('Europe/Prague'); 26 | # MySQL access for InterText database: 27 | $DB_SERVER = "localhost"; 28 | $DB_USER = "intertext"; 29 | $DB_PASSWORD = "intertext"; 30 | $DB_DATABASE = "intertext"; 31 | # MySQL access for user database 32 | $U_SERVER = $DB_SERVER; 33 | $U_USER = $DB_USER; 34 | $U_PASSWORD = $DB_PASSWORD; 35 | $U_DATABASE = $DB_DATABASE; 36 | $U_TABLE = 'users'; 37 | $U_USERNAME = 'username'; 38 | $U_USERPASS = 'password'; 39 | $U_USERTYPE = 'status'; 40 | $U_USERID = 'id'; 41 | $U_FIRSTNAME = 'name'; 42 | $U_SURNAME = 'surname'; 43 | # USER levels <=> values in database, column $U_USERTYPE 44 | $USER_ADMIN = 0; # main administrator 45 | $USER_RESP = 1; # supervisor / section coordinator / responsible 46 | $USER_EDITOR = 2; # editor 47 | # ordering of alignmnets (do not change unless you know what and why!) 48 | $ALORDER = array( 49 | 'ver1asc' => 'v1.version_name ASC', 50 | 'ver1desc' => 'v1.version_name DESC', 51 | 'ver2asc' => 'v2.version_name ASC', 52 | 'ver2desc' => 'v2.version_name DESC', 53 | 'edasc' => 'a.editor ASC', 54 | 'eddesc' => 'a.editor DESC', 55 | 'respasc' => 'a.resp ASC', 56 | 'respdesc' => 'a.resp DESC', 57 | 'statasc' => 'a.status ASC, a.id DESC', 58 | 'statdesc' => 'a.status DESC, a.id DESC' 59 | ); 60 | # default order in the list of alignments 61 | $DEFAULT_TORDER = 'asc'; # primary sorting by text name ('asc', 'desc' or '' for no ordering by text name) 62 | $DEFAULT_ALORDER = 'ver1asc'; 63 | # names of modes 64 | $MODES=array( 65 | '1'=>"manual status update", 66 | '6'=>'manual & roll (-5)', 67 | '7'=>'manual & roll (-2)', 68 | '8'=>'manual & roll (act.)', 69 | '2'=>'auto update status', 70 | '3'=>'auto & roll (-5)', 71 | '4'=>'auto & roll (-2)', 72 | '5'=>'auto & roll (act.)' 73 | ); 74 | # default mode 75 | $DEFAULT_MODE=4; 76 | # available limits of positions per page 77 | $LIMITS = array('10','20','50','100'); 78 | # default limit (positions per page) 79 | $DEFAULT_LIMIT=20; 80 | # Highlight non-1:1 alignments by default? 81 | $DEFAULT_HIGHLIGHT = 1; # 1=true, 0=false 82 | # Hide controls by default? 83 | $DEFAULT_HIDE = 0; # 1=true, 0=false 84 | # Default permission to edit texts 85 | $DEFAULT_EDIT_PERMISSION = 1; # 1=true; 0=false 86 | # Default permission to change structure of central/pivot text versions 87 | $DEFAULT_C_CHSTRUCT_PERMISSION = 0; # 1=true; 0=false 88 | # Central/pivot text versions (protected of structure changes by the c_chstruct attribute) 89 | $C_VERSION = 'cs-.*'; # Czech versions for InterCorp 90 | # default alignment method and profile (for automatic alignment) 91 | $DEFAULT_METHOD='hunalign'; 92 | $DEFAULT_PROFILE='_none_'; 93 | #$DEFAULT_METHOD='tca2'; 94 | #$DEFAULT_PROFILE='no-cs'; 95 | # Default XML elements containing alignable text 96 | $DEFAULT_TEXT_ELEMENTS = 'head s verse'; 97 | # Back links 98 | $TXTMGR_URL = ''; 99 | $TXTMGR_TEXT = ''; 100 | # Logout URL 101 | $LOGOUT_URL = 'aligner.php'; 102 | # Global permissions 103 | # $SET['newalign']: permission to CREATE new alignments 104 | # $SET['delalign']: permission to DELETE alignments 105 | # $SET['realign']: permission to run automatic alignment again from any position 106 | # $SET['chalmethod']: permission to change method for authomatic re-alignment 107 | # $SET['export']: permission to export texts and/or alignment 108 | $SET['newalign'] = false; 109 | $SET['delalign'] = false; 110 | $SET['realign'] = true; 111 | $SET['chalmethod'] = true; 112 | $SET['export'] = true; 113 | # Maximal user level for upload of new alignments from the client InterText editor application 114 | # (the user will also be allowed to download any text version from the database!) 115 | $UPLOAD_MAXUSERLEVEL_CLIENT = $USER_ADMIN; 116 | # Maximal user level for download of isolated text versions 117 | $DOWNLOAD_TXTVER_MAXUSERLEVEL = $USER_ADMIN; 118 | # Filter text versions freely accessible for download (limited to user with the UPLOAD permission above) 119 | $DOWNLOAD_TXTVER_FILTER = '.*'; # all versions / "cs-.*": only Czech versions for InterCorp 120 | # Tags allowed in text: 121 | $TAGS_IN_TEXT="i|b|u|emph"; 122 | # Use logging of text editation changes? 123 | $LOG_EDIT_CHANGES = true; 124 | # Log all changes in alignments! 125 | $LOG_ALIGN_CHANGES = false; 126 | # Enforce single level (re)numbering of alignable elements 127 | # (and keep original IDs of all other elements!) 128 | $FORCE_SIMPLE_NUMBERING = false; 129 | # ignore unconfirmed alignments when checking for merge conflicts 130 | $MERGE_UNCONFIRMED_FREELY = false; 131 | # deny users to remove text from elements 132 | $DENY_EMPTY_UPDATES = true; 133 | # disable fulltext search (necessary for MySQL <= 5.5) 134 | $DISABLE_FULLTEXT = false; 135 | ?> -------------------------------------------------------------------------------- /config/default_permissions.php: -------------------------------------------------------------------------------- 1 | . 20 | * 21 | */ 22 | 23 | #### Default settings for ADMIN #### 24 | if ($USER['type']==$USER_ADMIN) { 25 | $SET['newalign'] = true; 26 | $SET['delalign'] = true; 27 | $SET['realign'] = true; 28 | $SET['chalmethod'] = true; 29 | $SET['export'] = true; 30 | $SET['client_upload'] = true; 31 | $TXTMGR_URL = 'textmanager.php'; 32 | $TXTMGR_TEXT = 'textmanager'; 33 | } 34 | ##################################### 35 | 36 | # Settings and permissions for particular alignment / text version / user 37 | function set_alignment_settings($alinfo) { 38 | global $SET,$TXTMGR_URL,$TXTMGR_TEXT,$USER,$C_VERSION,$USER_ADMIN; 39 | ###### INPUT array keys for $alinfo array: 40 | # text_name: name of the text 41 | # ver1_id: ID of text version 1 42 | # ver1_name: name of text version 1 43 | # ver2_id: ID of text version 2 44 | # ver2_name: name of text version 2 45 | ###### OUTPUT array for each version: 46 | # $SET[]['chtext']: permisssion to change text (=edit element contents) 47 | # $SET[]['chstruct']: permisssion to change text structure (=split/merge elements) 48 | # $SET['reaonly']: do not allow any changes to the alignment, read-only access 49 | 50 | # Here, some defaults can be set per user, too 51 | global $DEFAULT_METHOD, $DEFAULT_PROFILE, $DEFAULT_HIGHLIGHT, $DEFAULT_MODE, $DEFAULT_LIMIT; 52 | 53 | if ($USER['type']<=$UPLOAD_MAXUSERLEVEL_CLIENT) 54 | $SET['client_upload'] = true; 55 | else 56 | $SET['client_upload'] = false; 57 | 58 | if ($USER['type']==$USER_ADMIN) { 59 | # admin can edit everything, always! 60 | $SET['readonly'] = FALSE; 61 | $SET[$alinfo['ver1_id']]['chtext'] = true; 62 | $SET[$alinfo['ver1_id']]['chstruct'] = true; 63 | $SET[$alinfo['ver2_id']]['chtext'] = true; 64 | $SET[$alinfo['ver2_id']]['chstruct'] = true; 65 | } else { 66 | # Deny everything by default for others 67 | $SET[$alinfo['ver1_id']]['chtext'] = false; 68 | $SET[$alinfo['ver1_id']]['chstruct'] = false; 69 | $SET[$alinfo['ver2_id']]['chtext'] = false; 70 | $SET[$alinfo['ver2_id']]['chstruct'] = false; 71 | $SET['readonly'] = TRUE; 72 | } 73 | 74 | if ($alinfo['editor']==$USER['id'] || $alinfo['resp']==$USER['id']) { 75 | if ($alinfo['chtext']) { 76 | $SET[$alinfo['ver1_id']]['chtext'] = true; 77 | $SET[$alinfo['ver2_id']]['chtext'] = true; 78 | if ($alinfo['c_chstruct'] || !preg_match("/^$C_VERSION$/",$alinfo['ver1_name'])) 79 | $SET[$alinfo['ver1_id']]['chstruct'] = true; 80 | if ($alinfo['c_chstruct'] || !preg_match("/^$C_VERSION$/",$alinfo['ver2_name'])) 81 | $SET[$alinfo['ver2_id']]['chstruct'] = true; 82 | } 83 | if ($alinfo['status']==ALSTAT_OPEN) $SET['readonly'] = FALSE; 84 | } 85 | 86 | ### Complete "Access denied" termination 87 | #require 'header.php'; 88 | #print "

Access denied!

\n

<< $TXTMGR_TEXT

\n\n"; 89 | #exit; 90 | 91 | return $SET; 92 | } 93 | ?> -------------------------------------------------------------------------------- /config/export_customization.php: -------------------------------------------------------------------------------- 1 | . 20 | * 21 | */ 22 | 23 | # Format header for exported files 24 | function format_exported_header($tname,$vname,$format,$idformat) { 25 | $ret = "\n"; 26 | return $ret; 27 | } 28 | 29 | # Format IDs for exported files 30 | function format_exported_ids($ename,$id,$tname,$vname,$format='',$idformat='',$filename='') { 31 | # add text name as ID for our root element 32 | if ($ename=='doc') { 33 | return $tname; 34 | } elseif ($id!='') { 35 | # for other elements with non-empty ID: 36 | switch ($idformat) { 37 | # generate InterCorp long ID 38 | case 'ic': 39 | $id = strtr($id,'.:-_,',':::::'); 40 | #$tname = strtolower($tname); 41 | #$vname = strtolower($vname); 42 | $vname = preg_replace('/-00$/','',$vname); 43 | $divid = 0; 44 | return "$vname:$tname:$divid:$id"; 45 | # generate ECPC filename based long ID 46 | case 'fn': 47 | $id = strtr($id,'.:-_,',':::::'); 48 | # trim the file extension 49 | $filename=preg_replace('/\..*$/','',$filename); 50 | return "$filename-se$id"; 51 | # or just ensure the use of colon as separator otherwise 52 | case '_alignable_': 53 | default: 54 | $id = strtr($id,'.:-_,',':::::'); 55 | return $id; 56 | } 57 | } else return ''; 58 | } 59 | ?> -------------------------------------------------------------------------------- /config/login_handler.php: -------------------------------------------------------------------------------- 1 | . 20 | * 21 | */ 22 | 23 | if ($_REQUEST['req']=='logout') { 24 | $_SESSION['username']=''; $_SESSION['passwd']=''; $USER['lang']=''; 25 | if (!$CLI_MODE) { Header ("Location: $LOGOUT_URL"); exit; } else { return; } 26 | } 27 | 28 | if (mktime()>$_SESSION['last_use']+60*30 AND !$_SESSION['no_logintimeout']) { 29 | $_SESSION['username']=''; $_SESSION['passwd']=''; $USER['lang']=''; 30 | } 31 | 32 | if ($_REQUEST['req']=='login') { 33 | $_SESSION['username']=$_REQUEST['login']; $_SESSION['passwd']=md5($_REQUEST['passwd']); 34 | if (IsSet($_REQUEST['no_logintimeout'])) 35 | $_SESSION['no_logintimeout']=1; 36 | else 37 | $_SESSION['no_logintimeout']=0; 38 | 39 | } 40 | 41 | if (!$DB = @mysqli_connect($U_SERVER,$U_USER,$U_PASSWORD,$U_DATABASE)) 42 | die("Cannot connect to the users database server: ".mysqli_error($DB)); 43 | if (!mysqli_set_charset($DB,"utf8")) 44 | die("Cannot set encoding: ".mysqli_error($DB)); 45 | 46 | $USER['username'] = $_SESSION['username']; 47 | $USER['passwd'] = $_SESSION['passwd']; 48 | 49 | ### Check username and password ### 50 | $cond = "($U_USERNAME='".mysqli_real_escape_string($DB,$USER['username'])."' COLLATE utf8_bin AND $U_USERPASS='".mysqli_real_escape_string($DB,$USER['passwd'])."' COLLATE utf8_bin)"; 51 | $query = "SELECT $U_USERID as id, $U_USERTYPE as type, $U_FIRSTNAME as firstname, $U_SURNAME as surname FROM $U_TABLE WHERE $cond"; 52 | if (!$dbresult = mysqli_query($DB,$query)) 53 | die("Cannot verify the user in the user database: ".mysqli_error($DB)); 54 | if (mysqli_num_rows($dbresult) != 1) { 55 | if ($_REQUEST['req']=='login') $WARNING="Invalid username or password."; 56 | $USER['username']=''; $USER['passwd']=''; $USER['type']=''; 57 | } else { 58 | $vysledek = mysqli_fetch_assoc($dbresult); 59 | $USER['type'] = $vysledek['type']; 60 | $USER['id'] = $vysledek['id']; 61 | $USER['firstname'] = $vysledek['firstname']; 62 | $USER['surname'] = $vysledek['surname']; 63 | $USER['name'] = "{$vysledek['surname']}, {$vysledek['firstname']}"; 64 | # Load all users into a field 65 | $query = "SELECT $U_USERID as id, $U_USERTYPE as type, $U_FIRSTNAME as firstname, $U_SURNAME as surname, $U_USERNAME as username FROM $U_TABLE ORDER BY $U_SURNAME, $U_FIRSTNAME"; 66 | if (!$dbresult = mysqli_query($DB,$query)) 67 | die("Cannot read users database: ".mysqli_error($DB)); 68 | $USERS['']=array('surname'=>'*** nobody ***', 'name'=>'*** nobody ***'); 69 | while ($user = mysqli_fetch_assoc($dbresult)) { 70 | $user['name'] = "{$user['surname']}, {$user['firstname']}"; 71 | $USERS[$user['id']] = $user; 72 | if ($user['type']==$USER_RESP) $RESPS[$user['id']] = $user; 73 | if ($user['type']==$USER_ADMIN) $ADMINS[$user['id']] = $user; 74 | } 75 | } 76 | mysqli_close($DB); 77 | $_SESSION['last_use']=mktime(); 78 | 79 | ### REQUIRE A VALID USER ### 80 | if ($USER['username']=='' && !$CLI_MODE) { 81 | require 'header.php'; 82 | # Print menubar 83 | print "
84 |  InterText 85 |
86 |
87 | "; 88 | if ($WARNING!='') printf(WARNING_FORMAT,$WARNING); 89 | print "
90 |
91 |
92 | User Login 93 | 94 | 95 | 97 | 98 | 99 | 100 |
96 |
Remember me on this computer
101 |
102 |
103 | 104 |

Do not forget to log out if working on a public computer!

105 |
106 | 107 |
108 | 109 | 110 | "; 111 | exit; 112 | } 113 | ?> -------------------------------------------------------------------------------- /css/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png -------------------------------------------------------------------------------- /css/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png -------------------------------------------------------------------------------- /css/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png -------------------------------------------------------------------------------- /css/cupertino/images/ui-bg_glass_50_3baae3_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-bg_glass_50_3baae3_1x400.png -------------------------------------------------------------------------------- /css/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png -------------------------------------------------------------------------------- /css/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png -------------------------------------------------------------------------------- /css/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png -------------------------------------------------------------------------------- /css/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png -------------------------------------------------------------------------------- /css/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png -------------------------------------------------------------------------------- /css/cupertino/images/ui-icons_2694e8_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-icons_2694e8_256x240.png -------------------------------------------------------------------------------- /css/cupertino/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /css/cupertino/images/ui-icons_3d80b3_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-icons_3d80b3_256x240.png -------------------------------------------------------------------------------- /css/cupertino/images/ui-icons_72a7cf_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-icons_72a7cf_256x240.png -------------------------------------------------------------------------------- /css/cupertino/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/css/cupertino/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /css/intertext.css: -------------------------------------------------------------------------------- 1 | /* InterText - parallel text alignment editor 2 | * 3 | * Copyright (c) 2010 Pavel Vondřička 4 | * 5 | * This software is distributed under the GNU General Public License v3. 6 | * http://www.gnu.org/licenses/gpl-3.0.html 7 | */ 8 | 9 | body { 10 | font-family: sans-serif; 11 | font-size: 16px; 12 | background: #ddf; 13 | padding: 0px; 14 | margin: 0px; 15 | } 16 | 17 | div#contents { 18 | padding: 10px; 19 | } 20 | 21 | div#help { 22 | margin: 10px; 23 | padding: 20px; 24 | background-color: white; 25 | border: 1px solid black; 26 | } 27 | 28 | 29 | div#help h1 { 30 | text-align: center; 31 | background-color: #ccc; 32 | } 33 | 34 | div#help h2 { 35 | border-bottom: 1px black solid; 36 | } 37 | 38 | div#help a, a:visited { 39 | color: #33d; 40 | text-decoration: none; 41 | margin: 0px; 42 | } 43 | 44 | div#help a:hover { 45 | color: #33d; 46 | text-decoration: underline; 47 | } 48 | 49 | table { 50 | font-size: 16px; 51 | } 52 | 53 | div#contents a, a:visited { 54 | color: #33d; 55 | text-decoration: none; 56 | margin: 0px; 57 | } 58 | 59 | div#contents a:hover { 60 | color: #33d; 61 | text-decoration: underline; 62 | } 63 | 64 | div#contents a.img { 65 | display: inline-block; 66 | padding: 3px; 67 | } 68 | 69 | div#contents a.img:hover { 70 | color: #33d; 71 | display: inline-block; 72 | background-color: #99f; 73 | padding: 3px; 74 | } 75 | 76 | img { 77 | border: none; 78 | } 79 | 80 | table.alignment { 81 | margin-left: auto; 82 | margin-right: auto; 83 | background: #fff; 84 | border: 2px solid black; 85 | border-collapse: collapse; 86 | width: 100%; 87 | } 88 | 89 | table.alignment th { 90 | font-weight: bold; 91 | background-color: #6ad; 92 | padding: 0 0.5em; 93 | border: 1px solid black; 94 | } 95 | 96 | table.alignment td { 97 | margin: 0px; 98 | padding: 3px; 99 | text-align: center; 100 | } 101 | 102 | table.alignment td.contents { 103 | text-align: left; 104 | vertical-align: top; 105 | font-size: 16px; 106 | font-family: 'Nimbus Roman No9', Times, serif; 107 | width: 45%; 108 | } 109 | 110 | table.alignment td.contents ul { 111 | margin: 0px; 112 | padding: 0px; 113 | list-style-position: inside; 114 | list-style-image: url('../icons/arrow.png'); 115 | } 116 | 117 | table.alignment td.contents ul li { 118 | margin: 0px; 119 | } 120 | 121 | table.alignment td.position { 122 | font-size: x-small; 123 | } 124 | 125 | table.alignment td.mark { 126 | border-right: 1px solid #ddd; 127 | font-size: x-small; 128 | } 129 | 130 | table.alignment td.ccontrols { 131 | border-right: 1px solid #ddd; 132 | font-size: x-small; 133 | } 134 | 135 | table.alignment td.status { 136 | border-left: 1px solid #ddd; 137 | } 138 | 139 | table.alignment td.lcontrols { 140 | border-right: 1px solid #ddd; 141 | margin: 0px; 142 | padding: 0px; 143 | } 144 | 145 | table.alignment td.rcontrols { 146 | margin: 0px; 147 | padding: 0px; 148 | } 149 | 150 | table.alignment td.contents img { 151 | float: left; 152 | margin: 7px 0px 0px 0px; 153 | } 154 | 155 | table.alignment td.contents img.chlb { 156 | float: left; 157 | margin: 3px 0px 0px 0px; 158 | } 159 | 160 | table.alignment td.contents img.merger { 161 | float: none; 162 | margin: 0px 2px; 163 | } 164 | 165 | table tr.odd td { 166 | background-color: #eee; 167 | } 168 | 169 | table.alignment tr.odd td { 170 | background-color: #eee; 171 | } 172 | 173 | table.alignment tr.act td { 174 | background-color: #fdd; 175 | } 176 | 177 | table.alignment tr.act-non11 td { 178 | background-color: #fdd; 179 | } 180 | 181 | table.alignment tr.odd-non11 td { 182 | background-color: #dd7; 183 | } 184 | 185 | table.alignment tr.even-non11 td { 186 | background-color: #ee8; 187 | } 188 | 189 | .non11 { 190 | background-color: #ff8; 191 | } 192 | 193 | table.pager { 194 | margin-left: auto; 195 | margin-right: auto; 196 | margin-top: 0.5em; 197 | margin-bottom: 0.5em; 198 | background: #fff; 199 | border: 2px solid black; 200 | border-collapse: collapse; 201 | width: 100%; 202 | } 203 | 204 | table.pager td { 205 | margin: 0px; 206 | padding: 0.5em 0.5em; 207 | text-align: left; 208 | vertical-align: top; 209 | } 210 | 211 | table.pager td.prev { 212 | text-align: left; 213 | width: 20%; 214 | } 215 | 216 | table.pager td.center { 217 | text-align: center; 218 | } 219 | 220 | table.pager td.next { 221 | text-align: right; 222 | width: 20%; 223 | } 224 | 225 | p.warning { 226 | display: block; 227 | width: 98%; 228 | margin-left: auto; 229 | margin-right: auto; 230 | font-weight: bold; 231 | text-align: center; 232 | color: #d33; 233 | background-color: #ddd; 234 | padding: 0.5em 0.5em; 235 | } 236 | 237 | table.control { 238 | border-collapse: collapse; 239 | width: 100%; 240 | height: 100%; 241 | } 242 | 243 | table.control td { 244 | padding: 0px; 245 | } 246 | 247 | table.control tr.upper td { 248 | vertical-align: top; 249 | } 250 | 251 | table.control tr.lower td { 252 | vertical-align: bottom; 253 | } 254 | 255 | table.texts { 256 | font-size: 16px; 257 | margin-right: auto; 258 | background: #fff; 259 | border: 2px solid black; 260 | border-collapse: collapse; 261 | } 262 | 263 | table.texts th { 264 | font-weight: bold; 265 | background-color: #6ad; 266 | padding: 0 0.5em; 267 | border: 1px solid black; 268 | } 269 | 270 | table.texts td { 271 | margin: 0px; 272 | padding: 3px; 273 | text-align: left; 274 | border: 1px solid black; 275 | vertical-align: top; 276 | } 277 | 278 | table.allist { 279 | font-size: 16px; 280 | margin-right: auto; 281 | background: #fff; 282 | border: 2px solid black; 283 | border-collapse: collapse; 284 | } 285 | 286 | table.allist th { 287 | font-weight: bold; 288 | background-color: #6ad; 289 | padding: 0 0.5em; 290 | border: 1px solid black; 291 | } 292 | 293 | table.allist td { 294 | margin: 0px; 295 | padding: 3px 10px; 296 | text-align: left; 297 | vertical-align: top; 298 | } 299 | 300 | table.allist tr.new td { 301 | border-top: 1px solid black; 302 | } 303 | 304 | span.version { 305 | } 306 | 307 | span.version span { 308 | display: none; 309 | } 310 | 311 | .chtext { 312 | } 313 | 314 | .add_version { 315 | display: none; 316 | padding: 3px 0px; 317 | } 318 | 319 | table.form td { 320 | padding: 5px 5px; 321 | } 322 | 323 | div#info { 324 | display: none; 325 | margin: auto; 326 | padding: 10px; 327 | margin-top: 20px; 328 | width: 600px; 329 | min-height: 100px; 330 | background-color: #fff; 331 | border: 2px black solid; 332 | } 333 | 334 | .ui-progressbar { 335 | height:1em; 336 | text-align: left; 337 | } 338 | 339 | div#log { 340 | display: none; 341 | margin: auto; 342 | padding: 10px; 343 | margin-top: 20px; 344 | width: 600px; 345 | min-height: 100px; 346 | color: #ddd; 347 | background-color: #000; 348 | font-size: 10px; 349 | font-style: Courier, monospace; 350 | border: 2px #666 solid; 351 | white-space: pre; 352 | } 353 | 354 | span.saveform { 355 | display: block; 356 | background-color: #aaa; 357 | } 358 | 359 | span.saveform form { 360 | display: block; 361 | margin: 0px; 362 | padding: 3px; 363 | background-color: #aaa; 364 | } 365 | 366 | .inline { 367 | display: inline; 368 | } 369 | 370 | img.newelement { 371 | padding-right: 0.5em; 372 | } 373 | 374 | .hidden { 375 | visibility: hidden; 376 | } 377 | 378 | .invisible { 379 | display: none; 380 | } 381 | 382 | div.login { 383 | text-align: center; 384 | } 385 | 386 | div.login fieldset { 387 | width: 300px; 388 | text-align: center; 389 | margin-left: auto; 390 | margin-right: auto; 391 | } 392 | 393 | div.login table { 394 | margin-left: auto; 395 | margin-right: auto; 396 | } 397 | 398 | div.login td { 399 | padding: 5px; 400 | } 401 | 402 | div.login p { 403 | font-size: x-small; 404 | } 405 | 406 | div#menubar { 407 | width: 100%; 408 | margin: 0px; 409 | padding: 3px 0px; 410 | background-color: #225; 411 | color: #ccc; 412 | border-bottom: 1px solid #669; 413 | } 414 | 415 | div#menubar a, a:visited { 416 | padding: 3px; 417 | margin: 0px 0px 0px 10px; 418 | color: #ccc; 419 | text-decoration: none; 420 | } 421 | 422 | div#menubar a:hover { 423 | color: #eef; 424 | text-decoration: none; 425 | } 426 | 427 | div#menubar span#logout { 428 | margin: 0px 10px; 429 | float: right; 430 | text-align: right; 431 | } 432 | 433 | div.exportbar { 434 | clear: both; 435 | display: none; 436 | background-color: #aaa; 437 | padding: 3px; 438 | } 439 | 440 | div.exportbar form { 441 | margin: 0px 10px; 442 | padding: 3px; 443 | } 444 | 445 | div.searchbar { 446 | clear: both; 447 | background-color: #aaa; 448 | padding: 3px; 449 | } 450 | 451 | div.searchbar form { 452 | padding: 3px; 453 | } 454 | 455 | div.searchbar form input.left { 456 | float: left; 457 | margin: 2px 10px; 458 | width: 20px; 459 | height: 20px; 460 | border: none; 461 | background-color: transparent; 462 | color: transparent; 463 | background-image: url('../icons/go-prev.png'); 464 | background-repeat: no-repeat; 465 | background-position: center center; 466 | cursor: pointer; 467 | text-indent: -9999em; 468 | } 469 | 470 | div.searchbar form input.right { 471 | float: right; 472 | margin: 2px 10px; 473 | width: 20px; 474 | height: 20px; 475 | border: none; 476 | background-color: transparent; 477 | color: transparent; 478 | background-image: url('../icons/go-next.png'); 479 | background-repeat: no-repeat; 480 | background-position: center center; 481 | cursor: pointer; 482 | text-indent: -9999em; 483 | } 484 | 485 | div#statbar { 486 | text-align: center; 487 | font-size: small; 488 | background-color: #ccc; 489 | padding: 3px; 490 | } 491 | 492 | tr.alstat_remote_editor td { 493 | background-color: #bbf; 494 | } 495 | 496 | tr.alstat_blocked td { 497 | background-color: #fdd; 498 | } 499 | 500 | tr.alstat_finished td { 501 | background-color: #aea; 502 | } 503 | 504 | tr.alstat_closed td { 505 | background-color: #ccc; 506 | } 507 | 508 | table.pager td.prev { 509 | width: 20px; 510 | } 511 | 512 | table.pager td.next { 513 | width: 20px; 514 | } 515 | 516 | a.active { 517 | background-color: #aaa; 518 | } 519 | 520 | table.allist img { 521 | margin: 2px 0px 0px 0px; 522 | } 523 | 524 | img.selected { 525 | /*background-color: #99a;*/ 526 | border: 1px black solid; 527 | } 528 | 529 | div.changelog { 530 | clear: both; 531 | } 532 | 533 | .changelog-table { 534 | border-collapse: collapse; 535 | border: 1px #999 solid; 536 | margin: auto; 537 | width: 100%; 538 | } 539 | 540 | .changelog-table td { 541 | /*border: 1px solid #666;*/ 542 | border: none; 543 | } 544 | 545 | div#contents .changelog-table td.changetext { 546 | /*color: red;*/ 547 | text-align: left; 548 | background-color: white; 549 | padding: 3px 10px; 550 | } 551 | div#contents .changelog-table td.changetext a, a:visited { 552 | /*color: red;*/ 553 | } 554 | 555 | div#contents .changelog-table td.mergehist { 556 | /*color: red;*/ 557 | background-color: white; 558 | padding: 10px 10px; 559 | } 560 | 561 | td.changeattr { 562 | font-size: 80%; 563 | } 564 | 565 | .comment { 566 | font-size: 70%; 567 | font-family: sans-serif; 568 | } 569 | 570 | div#contents .changelog-table td.changetype_E { 571 | background-color: #FFFFBE; 572 | } 573 | 574 | div#contents .changelog-table td.changetype_M { 575 | background-color: #7BB31A; 576 | } 577 | 578 | div#contents .changelog-table td.changetype_S { 579 | background-color: #6194BC; 580 | } 581 | 582 | div#contents .changelog-table td.changetype_I { 583 | background-color: #A5D1F3; 584 | } 585 | 586 | div#contents .changelog-table td.changetype_D { 587 | background-color: #CC6600; 588 | } 589 | 590 | div#contents .changelog-table td.changetype_X { 591 | background-color: #C13100; 592 | } 593 | 594 | div#contents .changelog-table td.changetype_R { 595 | background-color: #FF9900; 596 | } 597 | 598 | div#contents .changelog-table td.changetype_N { 599 | background-color: #D0EAFF; 600 | } 601 | 602 | #filter_form { 603 | background-color: #225; 604 | color: #ddf; 605 | padding: 3px; 606 | } 607 | 608 | tr#filter td { 609 | background-color: #225; 610 | color: #ddf; 611 | } 612 | 613 | table.alchangelog-table { 614 | font-size: 12px; 615 | margin-right: auto; 616 | background: #fff; 617 | border: 1px solid black; 618 | border-collapse: collapse; 619 | } 620 | 621 | table.alchangelog-table th { 622 | font-weight: bold; 623 | background-color: #6ad; 624 | padding: 0 0.5em; 625 | } 626 | 627 | table.alchangelog-table td { 628 | margin: 0px; 629 | padding: 0px 5px; 630 | text-align: left; 631 | vertical-align: top; 632 | } 633 | 634 | table.alchangelog-table tr:nth-child(even) { 635 | background-color: #ddd; 636 | } 637 | 638 | table.alchangelog-table tr:nth-child(odd) { 639 | background-color: #fff; 640 | } 641 | 642 | table.alchangelog-table td.right { 643 | text-align: right; 644 | } -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:apache 2 | 3 | RUN apt-get update && apt-get -y install git 4 | 5 | RUN git clone https://github.com/czcorpus/InterText_server.git . 6 | 7 | RUN docker-php-ext-install mysqli 8 | 9 | RUN cp /var/www/html/icons/* /usr/share/apache2/icons 10 | 11 | RUN ln -s /usr/local/bin/php /usr/bin/php 12 | 13 | #COPY hunalign /var/www/html/hunalign/ 14 | -------------------------------------------------------------------------------- /docker/Readme.md: -------------------------------------------------------------------------------- 1 | # InterText server docker setup 2 | 3 | This folder contains a self-maintained Docker setup for the InterText server. To use the setup you need to first build the *intertext* image using the Dockerfile below and then you can start the service using the provided docker-compose configuration. Of course, this all assumes you have the official docker and docker-compose commands installed on your system. 4 | 5 | ## Dockerfile 6 | 7 | As there is no image at any public repository at the moment, you need to run this script to build the image locally. The script clones the official Github repository and creates an image using the latest sources. You need only the files from this folder to build the image. 8 | 9 | If you want *hunalign* functionality, you need to acquire the binary (eg. from the GUI version of the program), copy it to this folder (same as the Dockerfile) and uncomment the last line of the Dockerfile. 10 | 11 | Once you are ready, simply run: 12 | 13 | ``` 14 | docker build -t intertext . 15 | ``` 16 | 17 | This will take a little while. If everything is succesful, you should see your *intertext* image on the list by running `docker images`. 18 | 19 | ## docker-compose 20 | 21 | This script will run the service and the database instance required for it to function. 22 | 23 | The configuration mounts a couple of scripts to initialize the database the first time the image is created. These will create the default users and tables needed for the page to load for the first time. 24 | 25 | We also mount the import folder to `/import` if you want to use the CLI tools to import many files. 26 | 27 | To run the service, simply run the folowing command in this folder: 28 | 29 | ``` 30 | docker-compose up -d 31 | ``` 32 | 33 | Then you can observe the running processes: 34 | 35 | ``` 36 | docker-compose ps 37 | ``` 38 | 39 | And the logs: 40 | 41 | ``` 42 | docker-compose logs 43 | ``` 44 | 45 | To enter the terminal to use the CLI tools use the following command: 46 | 47 | ``` 48 | docker exec -it intertext_www_1 bash 49 | ``` 50 | 51 | Then simply enter the `cli` dir and try out all the commands there. Remeber, you can share the files between the docker containter and the host using the `./import` dir (mounted as `/import` inside the container). 52 | -------------------------------------------------------------------------------- /docker/config.php: -------------------------------------------------------------------------------- 1 | . 20 | * 21 | */ 22 | 23 | ### General defaults 24 | # set default timezone 25 | date_default_timezone_set('Europe/Prague'); 26 | # MySQL access for InterText database: 27 | $DB_SERVER = "db"; 28 | $DB_USER = "intertext"; 29 | $DB_PASSWORD = "intertext"; 30 | $DB_DATABASE = "intertext"; 31 | # MySQL access for user database 32 | $U_SERVER = $DB_SERVER; 33 | $U_USER = $DB_USER; 34 | $U_PASSWORD = $DB_PASSWORD; 35 | $U_DATABASE = $DB_DATABASE; 36 | $U_TABLE = 'users'; 37 | $U_USERNAME = 'username'; 38 | $U_USERPASS = 'password'; 39 | $U_USERTYPE = 'status'; 40 | $U_USERID = 'id'; 41 | $U_FIRSTNAME = 'name'; 42 | $U_SURNAME = 'surname'; 43 | # USER levels <=> values in database, column $U_USERTYPE 44 | $USER_ADMIN = 0; # main administrator 45 | $USER_RESP = 1; # supervisor / section coordinator / responsible 46 | $USER_EDITOR = 2; # editor 47 | # ordering of alignmnets (do not change unless you know what and why!) 48 | $ALORDER = array( 49 | 'ver1asc' => 'v1.version_name ASC', 50 | 'ver1desc' => 'v1.version_name DESC', 51 | 'ver2asc' => 'v2.version_name ASC', 52 | 'ver2desc' => 'v2.version_name DESC', 53 | 'edasc' => 'a.editor ASC', 54 | 'eddesc' => 'a.editor DESC', 55 | 'respasc' => 'a.resp ASC', 56 | 'respdesc' => 'a.resp DESC', 57 | 'statasc' => 'a.status ASC, a.id DESC', 58 | 'statdesc' => 'a.status DESC, a.id DESC' 59 | ); 60 | # default order in the list of alignments 61 | $DEFAULT_TORDER = 'asc'; # primary sorting by text name ('asc', 'desc' or '' for no ordering by text name) 62 | $DEFAULT_ALORDER = 'ver1asc'; 63 | # names of modes 64 | $MODES=array( 65 | '1'=>"manual status update", 66 | '6'=>'manual & roll (-5)', 67 | '7'=>'manual & roll (-2)', 68 | '8'=>'manual & roll (act.)', 69 | '2'=>'auto update status', 70 | '3'=>'auto & roll (-5)', 71 | '4'=>'auto & roll (-2)', 72 | '5'=>'auto & roll (act.)' 73 | ); 74 | # default mode 75 | $DEFAULT_MODE=4; 76 | # available limits of positions per page 77 | $LIMITS = array('10','20','50','100'); 78 | # default limit (positions per page) 79 | $DEFAULT_LIMIT=20; 80 | # Highlight non-1:1 alignments by default? 81 | $DEFAULT_HIGHLIGHT = 1; # 1=true, 0=false 82 | # Hide controls by default? 83 | $DEFAULT_HIDE = 0; # 1=true, 0=false 84 | # Default permission to edit texts 85 | $DEFAULT_EDIT_PERMISSION = 1; # 1=true; 0=false 86 | # Default permission to change structure of central/pivot text versions 87 | $DEFAULT_C_CHSTRUCT_PERMISSION = 0; # 1=true; 0=false 88 | # Central/pivot text versions (protected of structure changes by the c_chstruct attribute) 89 | $C_VERSION = 'cs-.*'; # Czech versions for InterCorp 90 | # default alignment method and profile (for automatic alignment) 91 | $DEFAULT_METHOD='hunalign'; 92 | $DEFAULT_PROFILE='_none_'; 93 | #$DEFAULT_METHOD='tca2'; 94 | #$DEFAULT_PROFILE='no-cs'; 95 | # Default XML elements containing alignable text 96 | $DEFAULT_TEXT_ELEMENTS = 'head s verse'; 97 | # Back links 98 | $TXTMGR_URL = ''; 99 | $TXTMGR_TEXT = ''; 100 | # Logout URL 101 | $LOGOUT_URL = 'aligner.php'; 102 | # Global permissions 103 | # $SET['newalign']: permission to CREATE new alignments 104 | # $SET['delalign']: permission to DELETE alignments 105 | # $SET['realign']: permission to run automatic alignment again from any position 106 | # $SET['chalmethod']: permission to change method for authomatic re-alignment 107 | # $SET['export']: permission to export texts and/or alignment 108 | $SET['newalign'] = false; 109 | $SET['delalign'] = false; 110 | $SET['realign'] = true; 111 | $SET['chalmethod'] = true; 112 | $SET['export'] = true; 113 | # Maximal user level for upload of new alignments from the client InterText editor application 114 | # (the user will also be allowed to download any text version from the database!) 115 | $UPLOAD_MAXUSERLEVEL_CLIENT = $USER_ADMIN; 116 | # Maximal user level for download of isolated text versions 117 | $DOWNLOAD_TXTVER_MAXUSERLEVEL = $USER_ADMIN; 118 | # Filter text versions freely accessible for download (limited to user with the UPLOAD permission above) 119 | $DOWNLOAD_TXTVER_FILTER = '.*'; # all versions / "cs-.*": only Czech versions for InterCorp 120 | # Tags allowed in text: 121 | $TAGS_IN_TEXT="i|b|u|emph"; 122 | # Use logging of text editation changes? 123 | $LOG_EDIT_CHANGES = true; 124 | # Log all changes in alignments! 125 | $LOG_ALIGN_CHANGES = false; 126 | # Enforce single level (re)numbering of alignable elements 127 | # (and keep original IDs of all other elements!) 128 | $FORCE_SIMPLE_NUMBERING = false; 129 | # ignore unconfirmed alignments when checking for merge conflicts 130 | $MERGE_UNCONFIRMED_FREELY = false; 131 | # deny users to remove text from elements 132 | $DENY_EMPTY_UPDATES = true; 133 | # disable fulltext search (necessary for MySQL <= 5.5) 134 | $DISABLE_FULLTEXT = false; 135 | ?> 136 | -------------------------------------------------------------------------------- /docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.3' 2 | 3 | services: 4 | db: 5 | image: mysql:5 6 | volumes: 7 | - db_data:/var/lib/mysql 8 | - ./init:/docker-entrypoint-initdb.d 9 | - ./mysql_charset.cnf:/etc/mysql/mysql.conf.d/charset.cnf 10 | restart: always 11 | environment: 12 | MYSQL_ROOT_PASSWORD: root 13 | MYSQL_DATABASE: intertext 14 | MYSQL_USER: intertext 15 | MYSQL_PASSWORD: intertext 16 | 17 | www: 18 | depends_on: 19 | - db 20 | build: 21 | context: ./ 22 | image: intertext:latest 23 | volumes: 24 | - ./config.php:/var/www/html/config/config.php 25 | - ./import:/import 26 | ports: 27 | - "80:80" 28 | restart: always 29 | volumes: 30 | db_data: {} 31 | -------------------------------------------------------------------------------- /docker/import/test_en.txt: -------------------------------------------------------------------------------- 1 | +Eh+ thank you, mister president, firstly, my thanks to mister Samecki for his good work. I think we all agree with the theme we're discussing here this morning, not only should it apply across the European Union but it sh~ should apply worldwide as well. And this is something we discussed recently at the Canadian delegation, which is a step in the right direction. But if we want that +eh+ utopian situation, we must ensure that the professional qualifications are of an equal standard across the European Union and worldwide, ideally. And there is anecdotal evidence to suggest that, in some countries at least, when students haven't reached the educational standard to qualify for a course, they can go to another country and pay to do it there. So there is need for independent verifiable evidence that the standards are equal and, if they are equal, then there is no excuse for not transposing this theme across the European Union and, hopefully, in due course, worldwide, to attain what we desire, free movement of professionals~ in labour. Thank you very much. 2 | -------------------------------------------------------------------------------- /docker/import/test_en.xml: -------------------------------------------------------------------------------- 1 | 2 | +Eh+ thank you, mister president, firstly, my thanks to mister Samecki for his good work.I think we all agree with the theme we're discussing here this morning, not only should it apply across the European Union but it sh~ should apply worldwide as well.And this is something we discussed recently at the Canadian delegation, which is a step in the right direction.But if we want that +eh+ utopian situation, we must ensure that the professional qualifications are of an equal standard across the European Union and worldwide, ideally.And there is anecdotal evidence to suggest that, in some countries at least, when students haven't reached the educational standard to qualify for a course, they can go to another country and pay to do it there.So there is need for independent verifiable evidence that the standards are equal and, if they are equal, then there is no excuse for not transposing this theme across the European Union and, hopefully, in due course, worldwide, to attain what we desire, free movement of professionals~ in labour.Thank you very much. -------------------------------------------------------------------------------- /docker/import/test_pl.txt: -------------------------------------------------------------------------------- 1 | Dziękuję bardzo, na początek dziękuję panu Sameckiego z~ z~ za jego pracę. Wszyscy zgadzamy się, że dyrektywa ta powinna obowiązywać +y+ nie tylko w Unii Europejskiej, ale nawet na całym świecie. My to dyskutowaliśmy w gronie delegacji do spraw kontaktów z Kanadą, ale by było to możliwe musimy dołożyć staranie, by porównywalne poziomy kwalifikacji w Europie, i na świecie też, powinno być uznawane. I jest taka anegdota, że w niektórych +y+ państwach, kiedy uczniowie nie zdają jakiegoś kursu to mogą pojechać do innego kraju i tam startować jeszcze raz czy zdawać łatwiej, dlatego musimy mieć system jasnych +yy+ kwalifikacji w całej Unii i, w stosownej chwili, może na całym świecie. Nawet byśmy mieli swobodny przepływ +y+ pracowników. Dziękuję. 2 | -------------------------------------------------------------------------------- /docker/import/test_pl.xml: -------------------------------------------------------------------------------- 1 | 2 | Dziękuję bardzo, na początek dziękuję panu Sameckiego z~ z~ za jego pracę.Wszyscy zgadzamy się, że dyrektywa ta powinna obowiązywać +y+ nie tylko w Unii Europejskiej, ale nawet na całym świecie.My to dyskutowaliśmy w gronie delegacji do spraw kontaktów z Kanadą, ale by było to możliwe musimy dołożyć staranie, by porównywalne poziomy kwalifikacji w Europie, i na świecie też, powinno być uznawane.I jest taka anegdota, że w niektórych +y+ państwach, kiedy uczniowie nie zdają jakiegoś kursu to mogą pojechać do innego kraju i tam startować jeszcze raz czy zdawać łatwiej, dlatego musimy mieć system jasnych +yy+ kwalifikacji w całej Unii i, w stosownej chwili, może na całym świecie.Nawet byśmy mieli swobodny przepływ +y+ pracowników.Dziękuję. -------------------------------------------------------------------------------- /docker/init/01.sql: -------------------------------------------------------------------------------- 1 | USE intertext; 2 | SET CHARACTER SET utf8; 3 | 4 | CREATE TABLE texts ( 5 | id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, 6 | name TINYTEXT, 7 | 8 | PRIMARY KEY (id), 9 | INDEX index_name (name(20)) 10 | ); 11 | 12 | CREATE TABLE `versions` ( 13 | id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, 14 | text_id BIGINT UNSIGNED, 15 | version_name TINYTEXT, 16 | root_id BIGINT UNSIGNED, 17 | text_changed BOOL DEFAULT FALSE, 18 | uniq_ids BOOL DEFAULT FALSE, 19 | text_elements TEXT NOT NULL, 20 | filename TEXT, 21 | 22 | PRIMARY KEY (id), 23 | INDEX index_text_id (text_id), 24 | INDEX index_name (version_name(20)) 25 | ); 26 | 27 | CREATE TABLE `alignments` ( 28 | id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, 29 | ver1_id BIGINT UNSIGNED, 30 | ver2_id BIGINT UNSIGNED, 31 | method TINYTEXT NOT NULL, 32 | profile TINYTEXT NOT NULL, 33 | resp INT UNSIGNED, 34 | editor INT UNSIGNED, 35 | c_chstruct BOOLEAN DEFAULT 0, 36 | chtext BOOLEAN DEFAULT 0, 37 | status INT UNSIGNED DEFAULT 0, 38 | remote_user BIGINT UNSIGNED, 39 | 40 | PRIMARY KEY (id), 41 | INDEX index_ver1 (ver1_id), 42 | INDEX index_ver2 (ver2_id), 43 | INDEX index_resp (resp), 44 | INDEX index_editor (editor), 45 | INDEX index_status (status), 46 | INDEX index_remote_user (remote_user) 47 | ); 48 | 49 | CREATE TABLE `users` ( 50 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 51 | `username` tinytext, 52 | `password` tinytext, 53 | `status` int(10) unsigned DEFAULT NULL, 54 | `name` tinytext, 55 | `surname` tinytext, 56 | PRIMARY KEY (`id`) 57 | ); 58 | 59 | INSERT INTO `users` VALUES 60 | (1,'admin','098f6bcd4621d373cade4e832627b4f6',0,'Admin','Allmighty'), 61 | (2,'resp','098f6bcd4621d373cade4e832627b4f6',1,'Responsible','Supervisor'), 62 | (3,'editor','098f6bcd4621d373cade4e832627b4f6',2,'Any','Editor'); 63 | -------------------------------------------------------------------------------- /docker/mysql_charset.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | character-set-server=utf8 3 | collation-server=utf8_general_ci 4 | -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | . 20 | * 21 | */ 22 | ?> 23 | 25 | 26 | 27 | InterText 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 164 | 165 | 166 | 167 | -------------------------------------------------------------------------------- /hunalign/_none_.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/hunalign/_none_.dic -------------------------------------------------------------------------------- /hunalign/process.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Insert preprocessing here (tokenizing, conversion to stemmed text, etc.) 4 | 5 | echo 'Running hunalign aligner...' 6 | ./hunalign -utf -realign $1.dic $2 $3 2>&1 >$4 7 | echo 'Hunalign finished.' 8 | -------------------------------------------------------------------------------- /icons/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/.DS_Store -------------------------------------------------------------------------------- /icons/.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | PreviewsShown=true 3 | Timestamp=2014,2,26,14,31,27 4 | Version=3 5 | -------------------------------------------------------------------------------- /icons/COPYING.LESSER: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /icons/LICENSE: -------------------------------------------------------------------------------- 1 | This directory contains images from the KDE project Oxygen: 2 | http://www.kde.org 3 | https://techbase.kde.org/Projects/Oxygen 4 | 5 | These icons are licensed under LGPL v3 (see COPYING.LESSER). 6 | -------------------------------------------------------------------------------- /icons/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/add.png -------------------------------------------------------------------------------- /icons/arrow-down-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/arrow-down-double.png -------------------------------------------------------------------------------- /icons/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/arrow-down.png -------------------------------------------------------------------------------- /icons/arrow-up-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/arrow-up-double.png -------------------------------------------------------------------------------- /icons/arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/arrow-up.png -------------------------------------------------------------------------------- /icons/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/arrow.png -------------------------------------------------------------------------------- /icons/asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/asc.png -------------------------------------------------------------------------------- /icons/automatic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/automatic.png -------------------------------------------------------------------------------- /icons/changelog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/changelog.png -------------------------------------------------------------------------------- /icons/desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/desc.png -------------------------------------------------------------------------------- /icons/dialog-ok-apply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/dialog-ok-apply.png -------------------------------------------------------------------------------- /icons/dialog-ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/dialog-ok.png -------------------------------------------------------------------------------- /icons/document-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/document-edit.png -------------------------------------------------------------------------------- /icons/document-export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/document-export.png -------------------------------------------------------------------------------- /icons/document-import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/document-import.png -------------------------------------------------------------------------------- /icons/document-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/document-new.png -------------------------------------------------------------------------------- /icons/document-save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/document-save.png -------------------------------------------------------------------------------- /icons/edit-delete-shred.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/edit-delete-shred.png -------------------------------------------------------------------------------- /icons/edit-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/edit-delete.png -------------------------------------------------------------------------------- /icons/edit-rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/edit-rename.png -------------------------------------------------------------------------------- /icons/flag-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/flag-red.png -------------------------------------------------------------------------------- /icons/flag-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/flag-yellow.png -------------------------------------------------------------------------------- /icons/format-list-ordered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/format-list-ordered.png -------------------------------------------------------------------------------- /icons/format-list-unordered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/format-list-unordered.png -------------------------------------------------------------------------------- /icons/go-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/go-down.png -------------------------------------------------------------------------------- /icons/go-first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/go-first.png -------------------------------------------------------------------------------- /icons/go-jump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/go-jump.png -------------------------------------------------------------------------------- /icons/go-last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/go-last.png -------------------------------------------------------------------------------- /icons/go-next-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/go-next-view.png -------------------------------------------------------------------------------- /icons/go-next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/go-next.png -------------------------------------------------------------------------------- /icons/go-prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/go-prev.png -------------------------------------------------------------------------------- /icons/go-previous-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/go-previous-view.png -------------------------------------------------------------------------------- /icons/go-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/go-up.png -------------------------------------------------------------------------------- /icons/help-contents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/help-contents.png -------------------------------------------------------------------------------- /icons/journal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/journal.png -------------------------------------------------------------------------------- /icons/layer-visible-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/layer-visible-off.png -------------------------------------------------------------------------------- /icons/layer-visible-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/layer-visible-on.png -------------------------------------------------------------------------------- /icons/legalmoves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/legalmoves.png -------------------------------------------------------------------------------- /icons/mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/mark.png -------------------------------------------------------------------------------- /icons/merge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/merge.png -------------------------------------------------------------------------------- /icons/nomark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/nomark.png -------------------------------------------------------------------------------- /icons/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/remove.png -------------------------------------------------------------------------------- /icons/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/search.png -------------------------------------------------------------------------------- /icons/status_unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/status_unknown.png -------------------------------------------------------------------------------- /icons/swap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/swap.png -------------------------------------------------------------------------------- /icons/to-check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czcorpus/InterText_server/d7d79e9452eb42652ce7133db0251a8e08aa23f7/icons/to-check.png -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | aligner.php -------------------------------------------------------------------------------- /init.php: -------------------------------------------------------------------------------- 1 | . 20 | * 21 | */ 22 | 23 | ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); 24 | 25 | # Session initialization 26 | ini_set('session.gc_maxlifetime', '31104000'); 27 | session_name('InterText_SID'); 28 | session_start(); 29 | $cookie=session_get_cookie_params(); 30 | $ctimeout = time()+60*60*24*30*12*5; 31 | setcookie(session_name(),session_id(),$ctimeout); 32 | 33 | require 'config/config.php'; 34 | require 'config/login_handler.php'; 35 | require 'config/default_permissions.php'; 36 | require 'config/export_customization.php'; 37 | ?> -------------------------------------------------------------------------------- /intertext.sql: -------------------------------------------------------------------------------- 1 | #DROP DATABASE intertext; 2 | SET default_storage_engine=InnoDB; 3 | CREATE DATABASE intertext DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; 4 | 5 | GRANT ALL PRIVILEGES ON intertext.* TO 'intertext'@'localhost' IDENTIFIED BY 'intertext'; 6 | 7 | USE intertext; 8 | 9 | CREATE TABLE texts ( 10 | id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, 11 | name TINYTEXT, 12 | 13 | PRIMARY KEY (id), 14 | INDEX index_name (name(20)) 15 | ); 16 | 17 | CREATE TABLE `versions` ( 18 | id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, 19 | text_id BIGINT UNSIGNED, 20 | version_name TINYTEXT, 21 | root_id BIGINT UNSIGNED, 22 | text_changed BOOL DEFAULT FALSE, 23 | uniq_ids BOOL DEFAULT FALSE, 24 | text_elements TEXT NOT NULL, 25 | filename TEXT, 26 | 27 | PRIMARY KEY (id), 28 | INDEX index_text_id (text_id), 29 | INDEX index_name (version_name(20)) 30 | ); 31 | 32 | CREATE TABLE `alignments` ( 33 | id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, 34 | ver1_id BIGINT UNSIGNED, 35 | ver2_id BIGINT UNSIGNED, 36 | method TINYTEXT NOT NULL, 37 | profile TINYTEXT NOT NULL, 38 | resp INT UNSIGNED, 39 | editor INT UNSIGNED, 40 | c_chstruct BOOLEAN DEFAULT 0, 41 | chtext BOOLEAN DEFAULT 0, 42 | status INT UNSIGNED DEFAULT 0, 43 | remote_user BIGINT UNSIGNED, 44 | 45 | PRIMARY KEY (id), 46 | INDEX index_ver1 (ver1_id), 47 | INDEX index_ver2 (ver2_id), 48 | INDEX index_resp (resp), 49 | INDEX index_editor (editor), 50 | INDEX index_status (status), 51 | INDEX index_remote_user (remote_user) 52 | ); 53 | -------------------------------------------------------------------------------- /js/jeip.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008 Joseph Scott, http://josephscott.org/ 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | // version: 0.1.2 25 | 26 | (function( $ ) { 27 | $.fn.eip = function( save_url, options ) { 28 | // Defaults 29 | var opt = { 30 | save_url : save_url, 31 | 32 | save_on_enter : true, 33 | cancel_on_esc : true, 34 | focus_edit : true, 35 | select_text : false, 36 | edit_event : "click", 37 | select_options : false, 38 | data : false, 39 | 40 | form_type : "text", // text, textarea, select 41 | size : false, // calculate at run time 42 | max_size : 60, 43 | rows : false, // calculate at run time 44 | max_rows : 10, 45 | cols : 60, 46 | 47 | savebutton_text : "SAVE", 48 | savebutton_class : "jeip-savebutton", 49 | cancelbutton_text : "CANCEL", 50 | cancelbutton_class : "jeip-cancelbutton", 51 | 52 | mouseover_class : "jeip-mouseover", 53 | editor_class : "jeip-editor", 54 | editfield_class : "jeip-editfield", 55 | 56 | saving_text : "Saving ...", 57 | saving_class : "jeip-saving", 58 | 59 | saving : '', 60 | 61 | start_form : '', 64 | 65 | text_form : '
', 66 | textarea_form : '
', 67 | start_select_form : '', 70 | 71 | after_save : function( self ) { 72 | for( var i = 0; i < 2; i++ ) { 73 | $( self ).fadeOut( "fast" ); 74 | $( self ).fadeIn( "fast" ); 75 | } 76 | }, 77 | on_error : function( msg ) { 78 | alert( "Error: " + msg ); 79 | } 80 | }; // defaults 81 | 82 | if( options ) { 83 | $.extend( opt, options ); 84 | } 85 | 86 | this.each( function( ) { 87 | var self = this; 88 | 89 | $( this ).bind( "mouseenter mouseleave", function( e ) { 90 | $( this ).toggleClass( opt.mouseover_class ); 91 | } ); 92 | 93 | $( this ).bind( opt.edit_event, function( e ) { 94 | _editMode( this ); 95 | } ); 96 | } ); // this.each 97 | 98 | // Private functions 99 | var _editMode = function( self ) { 100 | $( self ).unbind( opt.edit_event ); 101 | 102 | $( self ).removeClass( opt.mouseover_class ); 103 | $( self ).fadeOut( "fast", function( e ) { 104 | var id = self.id; 105 | var value = $( self ).html( ); 106 | 107 | var safe_value = value.replace( //g, ">" ); 109 | safe_value = value.replace( /"/g, "&qout;" ); 110 | 111 | var orig_option_value = false; 112 | 113 | var form = _template( opt.start_form, { 114 | id : self.id, 115 | editor_class : opt.editor_class 116 | } ); 117 | 118 | if( opt.form_type == 'text' ) { 119 | form += _template( opt.text_form, { 120 | id : self.id, 121 | editfield_class : opt.editfield_class, 122 | value : value 123 | } ); 124 | } // text form 125 | else if( opt.form_type == 'textarea' ) { 126 | var length = value.length; 127 | var rows = ( length / opt.cols ) + 2; 128 | 129 | for( var i = 0; i < length; i++ ) { 130 | if( value.charAt( i ) == "\n" ) { 131 | rows++; 132 | } 133 | } 134 | 135 | if( rows > opt.max_rows ) { 136 | rows = opt.max_rows; 137 | } 138 | if( opt.rows != false ) { 139 | rows = opt.rows; 140 | } 141 | rows = parseInt( rows ); 142 | 143 | form += _template( opt.textarea_form, { 144 | id : self.id, 145 | cols : opt.cols, 146 | rows : rows, 147 | editfield_class : opt.editfield_class, 148 | value : value 149 | } ); 150 | } // textarea form 151 | else if( opt.form_type == 'select' ) { 152 | form += _template( opt.start_select_form, { 153 | id : self.id, 154 | editfield_class : opt.editfield_class 155 | } ); 156 | 157 | $.each( opt.select_options, function( k, v ) { 158 | var selected = ''; 159 | if( v == value ) { 160 | selected = 'selected="selected"'; 161 | } 162 | 163 | if( value == v ) { 164 | orig_option_value = k; 165 | } 166 | 167 | form += _template( opt.select_option_form, { 168 | id : self.id, 169 | option_value: k, 170 | option_text : v, 171 | selected : selected 172 | } ); 173 | } ); 174 | 175 | form += _template( opt.stop_select_form, { } ); 176 | } // select form 177 | 178 | form += _template( opt.form_buttons, { 179 | id : self.id, 180 | savebutton_class : opt.savebutton_class, 181 | savebutton_text : opt.savebutton_text, 182 | cancelbutton_class : opt.cancelbutton_class, 183 | cancelbutton_text : opt.cancelbutton_text 184 | } ); 185 | 186 | form += _template( opt.stop_form, { } ); 187 | 188 | $( self ).after( form ); 189 | $( "#editor-" + self.id ).fadeIn( "fast" ); 190 | 191 | if( opt.focus_edit ) { 192 | $( "#edit-" + self.id ).focus( ); 193 | } 194 | 195 | if( opt.select_text ) { 196 | $( "#edit-" + self.id ).select( ); 197 | } 198 | 199 | $( "#cancel-" + self.id ).bind( "click", function( e ) { 200 | _cancelEdit( self ); 201 | } ); 202 | 203 | $( "#edit-" + self.id ).keydown( function( e ) { 204 | // cancel 205 | if( e.which == 27 ) { 206 | _cancelEdit( self ); 207 | } 208 | 209 | // save 210 | if( opt.form_type != "textarea" && e.which == 13 ) { 211 | _saveEdit( self, orig_option_value ); 212 | } 213 | } ); 214 | 215 | $( "#save-" + self.id ).bind( "click", function( e ) { 216 | return _saveEdit( self, orig_option_value ); 217 | } ); // save click 218 | } ); // this fadeOut 219 | } // function _editMode 220 | 221 | var _template = function( template, values ) { 222 | var replace = function( str, match ) { 223 | return typeof values[match] === "string" || typeof values[match] === 'number' ? values[match] : str; 224 | }; 225 | return template.replace( /#\{([^{}]*)}/g, replace ); 226 | }; 227 | 228 | var _trim = function( str ) { 229 | return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); 230 | } 231 | 232 | var _cancelEdit = function( self ) { 233 | $( "#editor-" + self.id ).fadeOut( "fast" ); 234 | $( "#editor-" + self.id ).remove( ); 235 | 236 | $( self ).bind( opt.edit_event, function( e ) { 237 | _editMode( self ); 238 | } ); 239 | 240 | $( self ).removeClass( opt.mouseover_class ); 241 | $( self ).fadeIn( "fast" ); 242 | }; 243 | 244 | var _saveEdit = function( self, orig_option_value ) { 245 | var orig_value = $( self ).html( ); 246 | var new_value = $( "#edit-" + self.id ).attr( "value" ); 247 | 248 | if( orig_value == new_value ) { 249 | $( "#editor-" + self.id ).fadeOut( "fast" ); 250 | $( "#editor-" + self.id ).remove( ); 251 | 252 | $( self ).bind( opt.edit_event, function( e ) { 253 | _editMode( self ); 254 | } ); 255 | 256 | $( self ).removeClass( opt.mouseover_class ); 257 | $( self ).fadeIn( "fast" ); 258 | 259 | return true; 260 | } 261 | 262 | $( "#editor-" + self.id ).after( _template( opt.saving, { 263 | id : self.id, 264 | saving_class: opt.saving_class, 265 | saving_text : opt.saving_text 266 | } ) ); 267 | $( "#editor-" + self.id ).fadeOut( "fast", function( ) { 268 | $( "#saving-" + self.id).fadeIn( "fast" ); 269 | } ); 270 | 271 | var ajax_data = { 272 | url : location.href, 273 | id : self.id, 274 | form_type : opt.form_type, 275 | orig_value : orig_value, 276 | new_value : $( "#edit-" + self.id ).attr( "value" ), 277 | data : opt.data 278 | } 279 | 280 | if( opt.form_type == 'select' ) { 281 | ajax_data.orig_option_value = orig_option_value; 282 | ajax_data.orig_option_text = orig_value; 283 | ajax_data.new_option_text = $( "#edit-option-" + self.id + "-" + new_value ).html( ); 284 | } 285 | 286 | $.ajax( { 287 | url : opt.save_url, 288 | type : "POST", 289 | dataType: "json", 290 | data : ajax_data, 291 | success : function( data ) { 292 | $( "#editor-" + self.id ).fadeOut( "fast" ); 293 | $( "#editor-" + self.id ).remove( ); 294 | 295 | if( data.is_error == true ) { 296 | opt.on_error( data.error_text ); 297 | } 298 | else { 299 | $( self ).html( data.html ); 300 | } 301 | 302 | $( "#saving-" + self.id ).fadeOut( "fast" ); 303 | $( "#saving-" + self.id ).remove( ); 304 | 305 | $( self ).bind( opt.edit_event, function( e ) { 306 | _editMode( self ); 307 | } ); 308 | 309 | $( self ).addClass( opt.mouseover_class ); 310 | $( self ).fadeIn( "fast" ); 311 | 312 | if( opt.after_save != false ) { 313 | opt.after_save( self ); 314 | } 315 | 316 | $( self ).removeClass( opt.mouseover_class ); 317 | } // success 318 | } ); // ajax 319 | }; // _saveEdit 320 | 321 | 322 | }; // inplaceEdit 323 | })( jQuery ); 324 | -------------------------------------------------------------------------------- /js/jxs.js: -------------------------------------------------------------------------------- 1 | //V3.01.A - http://www.openjs.com/scripts/jx/ 2 | jx = { 3 | //Create a xmlHttpRequest object - this is the constructor. 4 | getHTTPObject : function() { 5 | var http = false; 6 | //Use IE's ActiveX items to load the file. 7 | if(typeof ActiveXObject != 'undefined') { 8 | try {http = new ActiveXObject("Msxml2.XMLHTTP");} 9 | catch (e) { 10 | try {http = new ActiveXObject("Microsoft.XMLHTTP");} 11 | catch (E) {http = false;} 12 | } 13 | //If ActiveX is not available, use the XMLHttpRequest of Firefox/Mozilla etc. to load the document. 14 | } else if (window.XMLHttpRequest) { 15 | try {http = new XMLHttpRequest();} 16 | catch (e) {http = false;} 17 | } 18 | return http; 19 | }, 20 | 21 | // This function is called from the user's script. 22 | //Arguments - 23 | // url - The url of the serverside script that is to be called. Append all the arguments to 24 | // this url - eg. 'get_data.php?id=5&car=benz' 25 | // callback - Function that must be called once the data is ready. 26 | // format - The return type for this function. Could be 'xml','json' or 'text'. If it is json, 27 | // the string will be 'eval'ed before returning it. Default:'text' 28 | // method - GET or POST. Default 'GET' 29 | load : function (url,callback,format,method, opt) { 30 | var http = this.init(); //The XMLHttpRequest object is recreated at every call - to defeat Cache problem in IE 31 | if(!http||!url) return; 32 | //XML Format need this for some Mozilla Browsers 33 | if (http.overrideMimeType) http.overrideMimeType('text/xml'); 34 | 35 | if(!method) method = "GET";//Default method is GET 36 | if(!format) format = "text";//Default return type is 'text' 37 | if(!opt) opt = {}; 38 | format = format.toLowerCase(); 39 | method = method.toUpperCase(); 40 | 41 | //Kill the Cache problem in IE. 42 | var now = "uid=" + new Date().getTime(); 43 | url += (url.indexOf("?")+1) ? "&" : "?"; 44 | url += now; 45 | 46 | var parameters = null; 47 | 48 | if(method=="POST") { 49 | var parts = url.split("\?"); 50 | url = parts[0]; 51 | parameters = parts[1]; 52 | } 53 | http.open(method, url, true); 54 | 55 | if(method=="POST") { 56 | http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 57 | http.setRequestHeader("Content-length", parameters.length); 58 | http.setRequestHeader("Connection", "close"); 59 | } 60 | 61 | var ths = this;// Closure 62 | if(opt.handler) { //If a custom handler is defined, use it 63 | http.onreadystatechange = function() { opt.handler(http); }; 64 | } else { 65 | http.onreadystatechange = function () {//Call a function when the state changes. 66 | if (http.readyState == 4) {//Ready State will be 4 when the document is loaded. 67 | if(http.status == 200) { 68 | var result = ""; 69 | if(http.responseText) result = http.responseText; 70 | //If the return is in JSON format, eval the result before returning it. 71 | if(format.charAt(0) == "j") { 72 | //\n's in JSON string, when evaluated will create errors in IE 73 | result = result.replace(/[\n\r]/g,""); 74 | result = eval('('+result+')'); 75 | 76 | } else if(format.charAt(0) == "x") { //XML Return 77 | result = http.responseXML; 78 | } 79 | 80 | //Give the data to the callback function. 81 | if(callback) callback(result); 82 | } else { 83 | if(opt.loadingIndicator) document.getElementsByTagName("body")[0].removeChild(opt.loadingIndicator); //Remove the loading indicator 84 | if(opt.loading) document.getElementById(opt.loading).style.display="none"; //Hide the given loading indicator. 85 | 86 | if(error) error(http.status); 87 | } 88 | } 89 | } 90 | } 91 | http.send(parameters); 92 | }, 93 | bind : function(user_options) { 94 | var opt = { 95 | 'url':'', //URL to be loaded 96 | 'onSuccess':false, //Function that should be called at success 97 | 'onError':false, //Function that should be called at error 98 | 'format':"text", //Return type - could be 'xml','json' or 'text' 99 | 'method':"GET", //GET or POST 100 | 'update':"", //The id of the element where the resulting data should be shown. 101 | 'loading':"", //The id of the loading indicator. This will be set to display:block when the url is loading and to display:none when the data has finished loading. 102 | 'loadingIndicator':"" //HTML that would be inserted into the document once the url starts loading and removed when the data has finished loading. This will be inserted into a div with class name 'loading-indicator' and will be placed at 'top:0px;left:0px;' 103 | } 104 | for(var key in opt) { 105 | if(user_options[key]) {//If the user given options contain any valid option, ... 106 | opt[key] = user_options[key];// ..that option will be put in the opt array. 107 | } 108 | } 109 | 110 | if(!opt.url) return; //Return if a url is not provided 111 | 112 | var div = false; 113 | if(opt.loadingIndicator) { //Show a loading indicator from the given HTML 114 | div = document.createElement("div"); 115 | div.setAttribute("style","position:absolute;top:0px;left:0px;"); 116 | div.setAttribute("class","loading-indicator"); 117 | div.innerHTML = opt.loadingIndicator; 118 | document.getElementsByTagName("body")[0].appendChild(div); 119 | this.opt.loadingIndicator=div; 120 | } 121 | if(opt.loading) document.getElementById(opt.loading).style.display="block"; //Show the given loading indicator. 122 | 123 | this.load(opt.url,function(data){ 124 | if(opt.onSuccess) opt.onSuccess(data); 125 | if(opt.update) document.getElementById(opt.update).innerHTML = data; 126 | 127 | if(div) document.getElementsByTagName("body")[0].removeChild(div); //Remove the loading indicator 128 | if(opt.loading) document.getElementById(opt.loading).style.display="none"; //Hide the given loading indicator. 129 | },opt.format,opt.method, opt); 130 | }, 131 | init : function() {return this.getHTTPObject();} 132 | } 133 | -------------------------------------------------------------------------------- /js/ui.core.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI 1.7.2 3 | * 4 | * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) 5 | * Dual licensed under the MIT (MIT-LICENSE.txt) 6 | * and GPL (GPL-LICENSE.txt) licenses. 7 | * 8 | * http://docs.jquery.com/UI 9 | */ 10 | ;jQuery.ui || (function($) { 11 | 12 | var _remove = $.fn.remove, 13 | isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9); 14 | 15 | //Helper functions and ui object 16 | $.ui = { 17 | version: "1.7.2", 18 | 19 | // $.ui.plugin is deprecated. Use the proxy pattern instead. 20 | plugin: { 21 | add: function(module, option, set) { 22 | var proto = $.ui[module].prototype; 23 | for(var i in set) { 24 | proto.plugins[i] = proto.plugins[i] || []; 25 | proto.plugins[i].push([option, set[i]]); 26 | } 27 | }, 28 | call: function(instance, name, args) { 29 | var set = instance.plugins[name]; 30 | if(!set || !instance.element[0].parentNode) { return; } 31 | 32 | for (var i = 0; i < set.length; i++) { 33 | if (instance.options[set[i][0]]) { 34 | set[i][1].apply(instance.element, args); 35 | } 36 | } 37 | } 38 | }, 39 | 40 | contains: function(a, b) { 41 | return document.compareDocumentPosition 42 | ? a.compareDocumentPosition(b) & 16 43 | : a !== b && a.contains(b); 44 | }, 45 | 46 | hasScroll: function(el, a) { 47 | 48 | //If overflow is hidden, the element might have extra content, but the user wants to hide it 49 | if ($(el).css('overflow') == 'hidden') { return false; } 50 | 51 | var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', 52 | has = false; 53 | 54 | if (el[scroll] > 0) { return true; } 55 | 56 | // TODO: determine which cases actually cause this to happen 57 | // if the element doesn't have the scroll set, see if it's possible to 58 | // set the scroll 59 | el[scroll] = 1; 60 | has = (el[scroll] > 0); 61 | el[scroll] = 0; 62 | return has; 63 | }, 64 | 65 | isOverAxis: function(x, reference, size) { 66 | //Determines when x coordinate is over "b" element axis 67 | return (x > reference) && (x < (reference + size)); 68 | }, 69 | 70 | isOver: function(y, x, top, left, height, width) { 71 | //Determines when x, y coordinates is over "b" element 72 | return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width); 73 | }, 74 | 75 | keyCode: { 76 | BACKSPACE: 8, 77 | CAPS_LOCK: 20, 78 | COMMA: 188, 79 | CONTROL: 17, 80 | DELETE: 46, 81 | DOWN: 40, 82 | END: 35, 83 | ENTER: 13, 84 | ESCAPE: 27, 85 | HOME: 36, 86 | INSERT: 45, 87 | LEFT: 37, 88 | NUMPAD_ADD: 107, 89 | NUMPAD_DECIMAL: 110, 90 | NUMPAD_DIVIDE: 111, 91 | NUMPAD_ENTER: 108, 92 | NUMPAD_MULTIPLY: 106, 93 | NUMPAD_SUBTRACT: 109, 94 | PAGE_DOWN: 34, 95 | PAGE_UP: 33, 96 | PERIOD: 190, 97 | RIGHT: 39, 98 | SHIFT: 16, 99 | SPACE: 32, 100 | TAB: 9, 101 | UP: 38 102 | } 103 | }; 104 | 105 | // WAI-ARIA normalization 106 | if (isFF2) { 107 | var attr = $.attr, 108 | removeAttr = $.fn.removeAttr, 109 | ariaNS = "http://www.w3.org/2005/07/aaa", 110 | ariaState = /^aria-/, 111 | ariaRole = /^wairole:/; 112 | 113 | $.attr = function(elem, name, value) { 114 | var set = value !== undefined; 115 | 116 | return (name == 'role' 117 | ? (set 118 | ? attr.call(this, elem, name, "wairole:" + value) 119 | : (attr.apply(this, arguments) || "").replace(ariaRole, "")) 120 | : (ariaState.test(name) 121 | ? (set 122 | ? elem.setAttributeNS(ariaNS, 123 | name.replace(ariaState, "aaa:"), value) 124 | : attr.call(this, elem, name.replace(ariaState, "aaa:"))) 125 | : attr.apply(this, arguments))); 126 | }; 127 | 128 | $.fn.removeAttr = function(name) { 129 | return (ariaState.test(name) 130 | ? this.each(function() { 131 | this.removeAttributeNS(ariaNS, name.replace(ariaState, "")); 132 | }) : removeAttr.call(this, name)); 133 | }; 134 | } 135 | 136 | //jQuery plugins 137 | $.fn.extend({ 138 | remove: function() { 139 | // Safari has a native remove event which actually removes DOM elements, 140 | // so we have to use triggerHandler instead of trigger (#3037). 141 | $("*", this).add(this).each(function() { 142 | $(this).triggerHandler("remove"); 143 | }); 144 | return _remove.apply(this, arguments ); 145 | }, 146 | 147 | enableSelection: function() { 148 | return this 149 | .attr('unselectable', 'off') 150 | .css('MozUserSelect', '') 151 | .unbind('selectstart.ui'); 152 | }, 153 | 154 | disableSelection: function() { 155 | return this 156 | .attr('unselectable', 'on') 157 | .css('MozUserSelect', 'none') 158 | .bind('selectstart.ui', function() { return false; }); 159 | }, 160 | 161 | scrollParent: function() { 162 | var scrollParent; 163 | if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { 164 | scrollParent = this.parents().filter(function() { 165 | return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); 166 | }).eq(0); 167 | } else { 168 | scrollParent = this.parents().filter(function() { 169 | return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); 170 | }).eq(0); 171 | } 172 | 173 | return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; 174 | } 175 | }); 176 | 177 | 178 | //Additional selectors 179 | $.extend($.expr[':'], { 180 | data: function(elem, i, match) { 181 | return !!$.data(elem, match[3]); 182 | }, 183 | 184 | focusable: function(element) { 185 | var nodeName = element.nodeName.toLowerCase(), 186 | tabIndex = $.attr(element, 'tabindex'); 187 | return (/input|select|textarea|button|object/.test(nodeName) 188 | ? !element.disabled 189 | : 'a' == nodeName || 'area' == nodeName 190 | ? element.href || !isNaN(tabIndex) 191 | : !isNaN(tabIndex)) 192 | // the element and all of its ancestors must be visible 193 | // the browser may report that the area is hidden 194 | && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length; 195 | }, 196 | 197 | tabbable: function(element) { 198 | var tabIndex = $.attr(element, 'tabindex'); 199 | return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable'); 200 | } 201 | }); 202 | 203 | 204 | // $.widget is a factory to create jQuery plugins 205 | // taking some boilerplate code out of the plugin code 206 | function getter(namespace, plugin, method, args) { 207 | function getMethods(type) { 208 | var methods = $[namespace][plugin][type] || []; 209 | return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods); 210 | } 211 | 212 | var methods = getMethods('getter'); 213 | if (args.length == 1 && typeof args[0] == 'string') { 214 | methods = methods.concat(getMethods('getterSetter')); 215 | } 216 | return ($.inArray(method, methods) != -1); 217 | } 218 | 219 | $.widget = function(name, prototype) { 220 | var namespace = name.split(".")[0]; 221 | name = name.split(".")[1]; 222 | 223 | // create plugin method 224 | $.fn[name] = function(options) { 225 | var isMethodCall = (typeof options == 'string'), 226 | args = Array.prototype.slice.call(arguments, 1); 227 | 228 | // prevent calls to internal methods 229 | if (isMethodCall && options.substring(0, 1) == '_') { 230 | return this; 231 | } 232 | 233 | // handle getter methods 234 | if (isMethodCall && getter(namespace, name, options, args)) { 235 | var instance = $.data(this[0], name); 236 | return (instance ? instance[options].apply(instance, args) 237 | : undefined); 238 | } 239 | 240 | // handle initialization and non-getter methods 241 | return this.each(function() { 242 | var instance = $.data(this, name); 243 | 244 | // constructor 245 | (!instance && !isMethodCall && 246 | $.data(this, name, new $[namespace][name](this, options))._init()); 247 | 248 | // method call 249 | (instance && isMethodCall && $.isFunction(instance[options]) && 250 | instance[options].apply(instance, args)); 251 | }); 252 | }; 253 | 254 | // create widget constructor 255 | $[namespace] = $[namespace] || {}; 256 | $[namespace][name] = function(element, options) { 257 | var self = this; 258 | 259 | this.namespace = namespace; 260 | this.widgetName = name; 261 | this.widgetEventPrefix = $[namespace][name].eventPrefix || name; 262 | this.widgetBaseClass = namespace + '-' + name; 263 | 264 | this.options = $.extend({}, 265 | $.widget.defaults, 266 | $[namespace][name].defaults, 267 | $.metadata && $.metadata.get(element)[name], 268 | options); 269 | 270 | this.element = $(element) 271 | .bind('setData.' + name, function(event, key, value) { 272 | if (event.target == element) { 273 | return self._setData(key, value); 274 | } 275 | }) 276 | .bind('getData.' + name, function(event, key) { 277 | if (event.target == element) { 278 | return self._getData(key); 279 | } 280 | }) 281 | .bind('remove', function() { 282 | return self.destroy(); 283 | }); 284 | }; 285 | 286 | // add widget prototype 287 | $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype); 288 | 289 | // TODO: merge getter and getterSetter properties from widget prototype 290 | // and plugin prototype 291 | $[namespace][name].getterSetter = 'option'; 292 | }; 293 | 294 | $.widget.prototype = { 295 | _init: function() {}, 296 | destroy: function() { 297 | this.element.removeData(this.widgetName) 298 | .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled') 299 | .removeAttr('aria-disabled'); 300 | }, 301 | 302 | option: function(key, value) { 303 | var options = key, 304 | self = this; 305 | 306 | if (typeof key == "string") { 307 | if (value === undefined) { 308 | return this._getData(key); 309 | } 310 | options = {}; 311 | options[key] = value; 312 | } 313 | 314 | $.each(options, function(key, value) { 315 | self._setData(key, value); 316 | }); 317 | }, 318 | _getData: function(key) { 319 | return this.options[key]; 320 | }, 321 | _setData: function(key, value) { 322 | this.options[key] = value; 323 | 324 | if (key == 'disabled') { 325 | this.element 326 | [value ? 'addClass' : 'removeClass']( 327 | this.widgetBaseClass + '-disabled' + ' ' + 328 | this.namespace + '-state-disabled') 329 | .attr("aria-disabled", value); 330 | } 331 | }, 332 | 333 | enable: function() { 334 | this._setData('disabled', false); 335 | }, 336 | disable: function() { 337 | this._setData('disabled', true); 338 | }, 339 | 340 | _trigger: function(type, event, data) { 341 | var callback = this.options[type], 342 | eventName = (type == this.widgetEventPrefix 343 | ? type : this.widgetEventPrefix + type); 344 | 345 | event = $.Event(event); 346 | event.type = eventName; 347 | 348 | // copy original event properties over to the new event 349 | // this would happen if we could call $.event.fix instead of $.Event 350 | // but we don't have a way to force an event to be fixed multiple times 351 | if (event.originalEvent) { 352 | for (var i = $.event.props.length, prop; i;) { 353 | prop = $.event.props[--i]; 354 | event[prop] = event.originalEvent[prop]; 355 | } 356 | } 357 | 358 | this.element.trigger(event, data); 359 | 360 | return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false 361 | || event.isDefaultPrevented()); 362 | } 363 | }; 364 | 365 | $.widget.defaults = { 366 | disabled: false 367 | }; 368 | 369 | 370 | /** Mouse Interaction Plugin **/ 371 | 372 | $.ui.mouse = { 373 | _mouseInit: function() { 374 | var self = this; 375 | 376 | this.element 377 | .bind('mousedown.'+this.widgetName, function(event) { 378 | return self._mouseDown(event); 379 | }) 380 | .bind('click.'+this.widgetName, function(event) { 381 | if(self._preventClickEvent) { 382 | self._preventClickEvent = false; 383 | event.stopImmediatePropagation(); 384 | return false; 385 | } 386 | }); 387 | 388 | // Prevent text selection in IE 389 | if ($.browser.msie) { 390 | this._mouseUnselectable = this.element.attr('unselectable'); 391 | this.element.attr('unselectable', 'on'); 392 | } 393 | 394 | this.started = false; 395 | }, 396 | 397 | // TODO: make sure destroying one instance of mouse doesn't mess with 398 | // other instances of mouse 399 | _mouseDestroy: function() { 400 | this.element.unbind('.'+this.widgetName); 401 | 402 | // Restore text selection in IE 403 | ($.browser.msie 404 | && this.element.attr('unselectable', this._mouseUnselectable)); 405 | }, 406 | 407 | _mouseDown: function(event) { 408 | // don't let more than one widget handle mouseStart 409 | // TODO: figure out why we have to use originalEvent 410 | event.originalEvent = event.originalEvent || {}; 411 | if (event.originalEvent.mouseHandled) { return; } 412 | 413 | // we may have missed mouseup (out of window) 414 | (this._mouseStarted && this._mouseUp(event)); 415 | 416 | this._mouseDownEvent = event; 417 | 418 | var self = this, 419 | btnIsLeft = (event.which == 1), 420 | elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false); 421 | if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { 422 | return true; 423 | } 424 | 425 | this.mouseDelayMet = !this.options.delay; 426 | if (!this.mouseDelayMet) { 427 | this._mouseDelayTimer = setTimeout(function() { 428 | self.mouseDelayMet = true; 429 | }, this.options.delay); 430 | } 431 | 432 | if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { 433 | this._mouseStarted = (this._mouseStart(event) !== false); 434 | if (!this._mouseStarted) { 435 | event.preventDefault(); 436 | return true; 437 | } 438 | } 439 | 440 | // these delegates are required to keep context 441 | this._mouseMoveDelegate = function(event) { 442 | return self._mouseMove(event); 443 | }; 444 | this._mouseUpDelegate = function(event) { 445 | return self._mouseUp(event); 446 | }; 447 | $(document) 448 | .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) 449 | .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); 450 | 451 | // preventDefault() is used to prevent the selection of text here - 452 | // however, in Safari, this causes select boxes not to be selectable 453 | // anymore, so this fix is needed 454 | ($.browser.safari || event.preventDefault()); 455 | 456 | event.originalEvent.mouseHandled = true; 457 | return true; 458 | }, 459 | 460 | _mouseMove: function(event) { 461 | // IE mouseup check - mouseup happened when mouse was out of window 462 | if ($.browser.msie && !event.button) { 463 | return this._mouseUp(event); 464 | } 465 | 466 | if (this._mouseStarted) { 467 | this._mouseDrag(event); 468 | return event.preventDefault(); 469 | } 470 | 471 | if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { 472 | this._mouseStarted = 473 | (this._mouseStart(this._mouseDownEvent, event) !== false); 474 | (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); 475 | } 476 | 477 | return !this._mouseStarted; 478 | }, 479 | 480 | _mouseUp: function(event) { 481 | $(document) 482 | .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) 483 | .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); 484 | 485 | if (this._mouseStarted) { 486 | this._mouseStarted = false; 487 | this._preventClickEvent = (event.target == this._mouseDownEvent.target); 488 | this._mouseStop(event); 489 | } 490 | 491 | return false; 492 | }, 493 | 494 | _mouseDistanceMet: function(event) { 495 | return (Math.max( 496 | Math.abs(this._mouseDownEvent.pageX - event.pageX), 497 | Math.abs(this._mouseDownEvent.pageY - event.pageY) 498 | ) >= this.options.distance 499 | ); 500 | }, 501 | 502 | _mouseDelayMet: function(event) { 503 | return this.mouseDelayMet; 504 | }, 505 | 506 | // These are placeholder methods, to be overriden by extending plugin 507 | _mouseStart: function(event) {}, 508 | _mouseDrag: function(event) {}, 509 | _mouseStop: function(event) {}, 510 | _mouseCapture: function(event) { return true; } 511 | }; 512 | 513 | $.ui.mouse.defaults = { 514 | cancel: null, 515 | distance: 1, 516 | delay: 0 517 | }; 518 | 519 | })(jQuery); 520 | -------------------------------------------------------------------------------- /js/ui.progressbar.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI Progressbar 1.7.2 3 | * 4 | * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) 5 | * Dual licensed under the MIT (MIT-LICENSE.txt) 6 | * and GPL (GPL-LICENSE.txt) licenses. 7 | * 8 | * http://docs.jquery.com/UI/Progressbar 9 | * 10 | * Depends: 11 | * ui.core.js 12 | */ 13 | (function($) { 14 | 15 | $.widget("ui.progressbar", { 16 | 17 | _init: function() { 18 | 19 | this.element 20 | .addClass("ui-progressbar" 21 | + " ui-widget" 22 | + " ui-widget-content" 23 | + " ui-corner-all") 24 | .attr({ 25 | role: "progressbar", 26 | "aria-valuemin": this._valueMin(), 27 | "aria-valuemax": this._valueMax(), 28 | "aria-valuenow": this._value() 29 | }); 30 | 31 | this.valueDiv = $('
').appendTo(this.element); 32 | 33 | this._refreshValue(); 34 | 35 | }, 36 | 37 | destroy: function() { 38 | 39 | this.element 40 | .removeClass("ui-progressbar" 41 | + " ui-widget" 42 | + " ui-widget-content" 43 | + " ui-corner-all") 44 | .removeAttr("role") 45 | .removeAttr("aria-valuemin") 46 | .removeAttr("aria-valuemax") 47 | .removeAttr("aria-valuenow") 48 | .removeData("progressbar") 49 | .unbind(".progressbar"); 50 | 51 | this.valueDiv.remove(); 52 | 53 | $.widget.prototype.destroy.apply(this, arguments); 54 | 55 | }, 56 | 57 | value: function(newValue) { 58 | if (newValue === undefined) { 59 | return this._value(); 60 | } 61 | 62 | this._setData('value', newValue); 63 | return this; 64 | }, 65 | 66 | _setData: function(key, value) { 67 | 68 | switch (key) { 69 | case 'value': 70 | this.options.value = value; 71 | this._refreshValue(); 72 | this._trigger('change', null, {}); 73 | break; 74 | } 75 | 76 | $.widget.prototype._setData.apply(this, arguments); 77 | 78 | }, 79 | 80 | _value: function() { 81 | 82 | var val = this.options.value; 83 | if (val < this._valueMin()) val = this._valueMin(); 84 | if (val > this._valueMax()) val = this._valueMax(); 85 | 86 | return val; 87 | 88 | }, 89 | 90 | _valueMin: function() { 91 | var valueMin = 0; 92 | return valueMin; 93 | }, 94 | 95 | _valueMax: function() { 96 | var valueMax = 100; 97 | return valueMax; 98 | }, 99 | 100 | _refreshValue: function() { 101 | var value = this.value(); 102 | this.valueDiv[value == this._valueMax() ? 'addClass' : 'removeClass']("ui-corner-right"); 103 | this.valueDiv.width(value + '%'); 104 | this.element.attr("aria-valuenow", value); 105 | } 106 | 107 | }); 108 | 109 | $.extend($.ui.progressbar, { 110 | version: "1.7.2", 111 | defaults: { 112 | value: 0 113 | } 114 | }); 115 | 116 | })(jQuery); 117 | -------------------------------------------------------------------------------- /progress.php: -------------------------------------------------------------------------------- 1 | . 20 | * 21 | */ 22 | ?> 23 |
24 |

Process: Running new alignment...

25 |
26 |

full log

27 |
28 |
29 | 65 | -------------------------------------------------------------------------------- /tca2/no-cs.cfg: -------------------------------------------------------------------------------- 1 | relevantElementNames=s head 2 | relevantAncestorElementNames=p div 3 | specialCharacters=.,;:?!&^(){}[]'„“"«»…‚’- 4 | scoringCharacters=?!%;:…*- 5 | lengthRatio=0.9 6 | diceMinWordLength=5 7 | diceMinCountingScore=0.7 8 | largeClusterScorePercentage=25 9 | anchorWordMatchWeight=1.8 10 | anchorPhraseMatchWeight=1.6 11 | properNameMatchWeight=1.3 12 | diceMatchWeight=1.1 13 | dicePhraseMatchWeight=1.3 14 | numberMatchWeight=1.3 15 | scoringCharacterMatchWeight=1.3 16 | maxPathLength=10 17 | ancestorInfo=none 18 | ancestorInfoElementNames= 19 | ancestorInfoAttributeNames= 20 | -------------------------------------------------------------------------------- /tca2/no-cs.dic: -------------------------------------------------------------------------------- 1 | —/— 2 | Jorunn/Janou,Jana 3 | liv*/život* 4 | men/ale 5 | og/a 6 | i/v,ve 7 | —/— 8 | Jorunn/Jan* 9 | Hilde/Hild* 10 | ja/ano 11 | nei/ne 12 | også/také,taky,i 13 | at/že 14 | for/pro,aby 15 | med/s 16 | hvilke*/jak*,kter* 17 | menneske*/člověk* 18 | Gud/Bůh,Boh* 19 | krist*/křes* 20 | dette/to*,ono 21 | denne/ten*,to* 22 | forst*/rozum*,pochop*,cháp* 23 | skjøn*/rozum*,pochop*,cháp* 24 | slik/tak 25 | sa/řekl*,prohlásil* 26 | sier/říká,tvrdí 27 | ja/ano,jo 28 | nei/ne 29 | av/z,ze 30 | hva/co 31 | hvem/kdo 32 | hvor/kde 33 | hel*/cel* 34 | i dag/dnes 35 | selvfølgelig/samozřejmě 36 | hvorfor/proč 37 | hvordan/jak 38 | når/kdy,když 39 | mange/mnoh*,hodně 40 | så/tak,takže 41 | nå/teď,nyní 42 | da/když,jak* 43 | Tomas/Tomáš* 44 | dag*/den*,dn* 45 | natt*/noc*,noč* 46 | to/dva,dvě 47 | han/on 48 | ham/jeho,ho,jej,něm 49 | henne/ona,jí,ní,ji 50 | hans/jeho 51 | hennes/její 52 | kan/mohu,mohou,může* 53 | jeg/já 54 | du/ty 55 | må/musí*,smí* 56 | tenk*/mysl* 57 | al*/vš* 58 | mandag/pondělí 59 | tirsdag/úterý 60 | onsdag/střed* 61 | torsdag/čtvrtek,čtvrtk* 62 | fredag/pátek,pátk* 63 | lørdag/sobot* 64 | søndag/neděl* 65 | føl*/cíti*,cítě* 66 | enn/než 67 | som/jak*,kter*,kdo,koho,komu,kým 68 | hør*/slyš* 69 | ingenting/nic 70 | vite/vědět 71 | visste/věděl* 72 | vet/ví 73 | meg/mně,mi,mě,mn* 74 | deg/tobě,ti,tě,teb* 75 | min/můj,má,mé*,moj* 76 | din/tvůj,tv* 77 | disse/tito,tyto,tato,takov* 78 | side*/stran* 79 | svar*/odpov* 80 | allerede/už 81 | likevel/přesto 82 | allikevel/přesto 83 | Cecilie/Cecílie,Cilk* 84 | ler/směj*,usmív* 85 | le/smát,usmívat 86 | lo/smál*,usmíval* 87 | far*/otec,otc* 88 | mor*/matk*,matce 89 | bare/jen,jenom,sotva 90 | Hobsyssel*/Kraj* 91 | trollm*/čarod* 92 | alv*/elf* 93 | dverg*/trpasl* 94 | fjell*/hor* -------------------------------------------------------------------------------- /textmanager.php: -------------------------------------------------------------------------------- 1 | . 20 | * 21 | */ 22 | 23 | $myurl= $_SERVER['PHP_SELF']; # 'textmanager.php'; 24 | define('WARNING_FORMAT',"

%s

"); 25 | 26 | require 'init.php'; 27 | # Only ADMIN has access to textmanager.php 28 | if ($USER['type']!=$USER_ADMIN) { Header('Location: aligner.php'); exit; } 29 | 30 | require 'lib_intertext.php'; 31 | $system = new InterText; 32 | 33 | if (IsSet($_REQUEST['req'])) $req = preg_replace('/[^a-z_]/','',$_REQUEST['req']); 34 | else $req = 'list'; 35 | if (IsSet($_REQUEST['txt'])) { $txt = preg_replace('/[^a-zA-Z0-9_\-]/','', $_REQUEST['txt']);setcookie('InterText_tmpageoffset',0,$ctimeout); } 36 | else $txt = ''; 37 | 38 | if (IsSet($_REQUEST['tmpagesize'])) { 39 | $tmpagesize = preg_replace('/[^0-9]/','',$_REQUEST['tmpagesize']); 40 | setcookie('InterText_tmpagesize',$tmpagesize,$ctimeout); 41 | } else { if (IsSet($_COOKIE['InterText_tmpagesize'])) $tmpagesize = $_COOKIE['InterText_tmpagesize']; else $tmpagesize = 30; } 42 | 43 | if (IsSet($_REQUEST['tmpageoffset'])) { 44 | $tmpageoffset = preg_replace('/[^0-9]/','',$_REQUEST['tmpageoffset']); 45 | setcookie('InterText_tmpageoffset',$tmpageoffset,$ctimeout); 46 | } else { if (IsSet($_COOKIE['InterText_tmpageoffset'])) $tmpageoffset = $_COOKIE['InterText_tmpageoffset']; else $tmpageoffset = 0; } 47 | 48 | if (IsSet($_REQUEST['tf_tname']) || IsSet($_REQUEST['tf_vname'])) { 49 | setcookie('InterText_tmpageoffset',0,$ctimeout);$tmpageoffset = 0; 50 | } 51 | 52 | if (IsSet($_REQUEST['tf_tname'])) $_SESSION['tf_tname'] = trim($_REQUEST['tf_tname']); 53 | if (IsSet($_REQUEST['tf_vname'])) $_SESSION['tf_vname'] = $_REQUEST['tf_vname']; 54 | 55 | # Processing requests that have to be processed before the HTML starts 56 | switch ($req) { 57 | case "update_ids": 58 | $id = preg_replace('/[^0-9]/','',$_REQUEST["id"]); 59 | $system->update_eids($txt,$id); 60 | break; 61 | case "export": 62 | $id = preg_replace('/[^0-9]/','',$_REQUEST["id"]); 63 | $format = preg_replace('/[^a-zA-Z_0-9\-:]/','',$_REQUEST['format']); 64 | $doc = $system->txtver_by_id($id); 65 | $fullname = $doc['text_name'].".".$doc['version_name']; 66 | $out = $system->export_document($txt,$id,0,$format); 67 | if ($out) { 68 | Header("Content-type: text/xml; charset=UTF-8"); 69 | Header("Content-Disposition: attachment; filename=\"$fullname.xml\""); 70 | print $out; 71 | } else { 72 | $_SESSION['WARNING'] = $_ERROR; 73 | Header("Location: $myurl"); 74 | } 75 | return; 76 | break; 77 | case 'delete_ver': 78 | $id = preg_replace('/[^0-9]/','',$_REQUEST["id"]); 79 | $system->delete_document($txt,$id); 80 | Header("Location: $myurl"); 81 | return; 82 | break; 83 | case 'upload_form': 84 | # Handle upload 85 | if (count($_FILES)>0) { 86 | $file = $_FILES['file']; 87 | $tname = trim(preg_replace('/[^_a-zA-Z0-9\-]/','',stripslashes($_REQUEST['tname']))); 88 | $vname = trim(preg_replace('/[^_a-zA-Z0-9\-]/','',stripslashes($_REQUEST['vname']))); 89 | $text_elements = trim(preg_replace('/[^_a-zA-Z0-9\-: ]/','',stripslashes($_REQUEST['text_elements']))); 90 | $text_elements = preg_replace('/ +/',' ',$text_elements); 91 | if (IsSet($_REQUEST['validate'])) $validate=true; 92 | else $validate = false; 93 | if (strlen($tname)==0) $WARNING = "ERROR: No text name given!"; 94 | elseif (strlen($vname)==0) $WARNING = "ERROR: No version name given!"; 95 | elseif (!strlen($file['tmp_name'])) $WARNING = "ERROR: No file to load!"; 96 | if (!IsSet($WARNING)) { 97 | if ($system->import_document($tname,$vname,$file['tmp_name'],$text_elements,false,$file['name'],$validate)) $req='list'; 98 | else $WARNING=$_ERROR; 99 | } 100 | } 101 | } 102 | 103 | function texts_count($versions) { 104 | $cnt = 0; 105 | $last = -1; 106 | foreach ($versions as $v) { 107 | if ($v['text_id']!=$last) {$cnt++;$last=$v['text_id'];} 108 | } 109 | return $cnt; 110 | } 111 | 112 | function texts_slice($versions, $from, $size) { 113 | $cnt = 0; 114 | $last = -1; 115 | $ret = array(); 116 | foreach ($versions as $v) { 117 | if ($v['text_id']!=$last) {$cnt++;$last=$v['text_id'];} 118 | if ($cnt>$from && $cnt<=$from+$size) {array_push($ret, $v);} 119 | } 120 | return $ret; 121 | } 122 | 123 | #### HTML PAGE START #### 124 | require 'header.php'; 125 | 126 | switch ($req) { 127 | case 'upload_form': 128 | ?> 129 | 133 |
134 | 138 |
139 |

Upload new text

140 |
141 |
142 | 143 | 144 | 145 | text_by_id($txtid); 151 | if ($txtid!='') $tname = $system->textname_by_id($txtid); 152 | ?> 153 | 154 | 155 | 156 | 157 | 159 | 160 | 161 | 162 | 163 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 189 |
Text name:
(Space separated list of XML element names containing text to be aligned.)
/> force DTD validation
187 | 188 |
190 |
191 |
192 |
193 |
194 |

Process: Uploading file...

195 |
196 | list_texts($tmpageoffset, $tmpagesize, $filter); 208 | 209 | # Print menu bar 210 | print "
\n"; 211 | print " [show:
]\n"; 218 | print "[users]"; 219 | print "[all alignments]"; 220 | print "[new text]"; 221 | print "[help][logout]\n"; 222 | print "
"; 223 | 224 | print "
\n"; 225 | 226 | # Print a warning 227 | if ($WARNING!='') printf(WARNING_FORMAT,$WARNING); 228 | 229 | print "

Available texts

\n\n"; 230 | 231 | $pager = ''; 232 | 233 | $tmcount = $system->texts_count($filter); 234 | 235 | if ($tmpagesize>0 && $tmcount>$tmpagesize) { 236 | //$texts = texts_slice($texts, $tmpageoffset, $tmpagesize); 237 | $curtextscount = texts_count($texts); 238 | $pager .= "

"; 239 | if ($tmpageoffset>0) { 240 | $i = $tmpageoffset - $tmpagesize; 241 | if ($i<0) $i=0; 242 | $pager .= "<< previous | "; 243 | } 244 | $pager .= "showing texts ".($tmpageoffset+1)."-".($tmpageoffset+$curtextscount). " of ".$tmcount; 245 | if ($tmpageoffset+$curtextscount<$tmcount) { 246 | $i = $tmpageoffset+$curtextscount; 247 | $pager .= " | next >>"; 248 | } 249 | $pager .= "

\n"; 250 | } 251 | 252 | print $pager; 253 | 254 | $lasttxtid=FALSE; 255 | print "\n"; 256 | ?> 257 | 258 | 259 | 260 | 274 | 277 | 278 | 279 | \"[ADD\n\n"; 283 | $lasttxtid = $version['text_id']; 284 | print "\n"; 285 | print "\n"; 307 | print "
Textversions 
261 | 275 | 276 |
all
{$version['text_name']}\n"; 286 | } 287 | $id = $version['version_id']; 288 | $tid = $version['text_id']; 289 | $fullname = trim($version['text_name'].'.'.$version['version_name']); 290 | print "\t\n"; 291 | print "\t\t{$version['version_name']}:\n"; 292 | print "\t\t\"[EXPORT]\"\n"; 293 | print "\t\t\"[UPDATE]\"\n"; 294 | if (!$version['uniq_ids']) { 295 | print "\t\t\"no\n"; 296 | } 297 | if ($version['text_changed']) { 298 | print "\t\t\"text\n"; 299 | } 300 | if ($version['alignment_count']==0) 301 | print "\t\t\"[DELETE]\"\n"; 302 | $format = ""; 303 | print "\t\t
$format
\n"; 304 | print "\t
\n"; 305 | } 306 | if (count($texts)) print "\t\"[ADD\n
all
\n"; 308 | print $pager; 309 | 310 | } 311 | ?> 312 |
313 | 314 | 315 | -------------------------------------------------------------------------------- /triggers/alstat_closed: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # script called when status 'closed' is set 4 | # parameters: text_name version1_name version2_name old_status alignment_id responsible_userid editor_userid 5 | # old_status can be 'open', 'finished', 'closed' or 'blocked' 6 | # last line written to STDOUT will be showed to the used as 'WARNING' 7 | 8 | #echo "alignment of text '$1', version '$2' and '$3' (with id '$5') changed status from '$4' to 'closed', responsible userid: $6, editor userid: $7" >/tmp/report.txt 9 | 10 | ### Export all files to $OUT_DIR 11 | #OUT_DIR=/tmp 12 | #cli/export -f xml_links:ic aid $5 >$OUT_DIR/$1.$2_$3.aln.xml 13 | #cli/export -f orig:ic t1aid $5 >$OUT_DIR/$1.$2.xml 14 | #cli/export -f orig:ic t2aid $5 >$OUT_DIR/$1.$3.xml 15 | 16 | #echo "Error message to show to the user." 17 | -------------------------------------------------------------------------------- /triggers/alstat_finished: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # script called when status 'finished' is set 4 | # parameters: text_name version1_name version2_name old_status alignment_id 5 | # old_status can be 'open', 'finished', 'closed' or 'blocked' 6 | # last line written to STDOUT will be showed to the used as 'WARNING' 7 | 8 | #echo "alignment of text '$1', version '$2' and '$3' (with id '$5') changed status from '$4' to 'finished'" >/tmp/report.txt 9 | 10 | #echo "Error message to show to the user." 11 | -------------------------------------------------------------------------------- /update-1.5.sql: -------------------------------------------------------------------------------- 1 | USE intertext; 2 | ALTER TABLE versions ADD COLUMN filename TEXT; 3 | ALTER TABLE versions ADD INDEX index_filename (filename(20)); 4 | -------------------------------------------------------------------------------- /update-2.0.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | . 21 | * 22 | */ 23 | 24 | set_time_limit(9999); 25 | $CLI_MODE = true; 26 | require 'init.php'; 27 | require 'lib_intertext.php'; 28 | $it = new InterText; 29 | 30 | $query = "ALTER TABLE alignments ADD COLUMN remote_user BIGINT UNSIGNED, ADD INDEX index_remote_user (remote_user)"; 31 | print "Modifying table 'alignments'.\n"; 32 | mysqli_query($it->DB,$query) OR print("- ERROR: Cannot modify database: ".mysqli_error($it->DB)."\n"); 33 | 34 | $query = "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='$DB_DATABASE' AND TABLE_NAME LIKE '%_changelog' AND TABLE_NAME NOT LIKE '%_align_%'"; 35 | if (!$dbresult = mysqli_query($it->DB,$query)) 36 | die("Cannot access database: ".mysqli_error($it->DB)); 37 | $tables = array(); 38 | while ($ret = mysqli_fetch_assoc($dbresult)) { $tables[] = $ret['TABLE_NAME']; } 39 | 40 | foreach($tables as $table) { 41 | $query = "ALTER TABLE $table ADD COLUMN open BOOLEAN DEFAULT FALSE, ADD INDEX index_open (open)"; 42 | print "Modifying table '$table'.\n"; 43 | mysqli_query($it->DB,$query) OR print("- ERROR: Cannot modify database: ".mysqli_error($it->DB)."\n"); 44 | } 45 | 46 | 47 | ?> -------------------------------------------------------------------------------- /update-2.2.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | . 21 | * 22 | */ 23 | 24 | set_time_limit(9999); 25 | $CLI_MODE = true; 26 | require 'init.php'; 27 | require 'lib_intertext.php'; 28 | $it = new InterText; 29 | 30 | $query = "ALTER TABLE texts ENGINE=InnoDB"; 31 | print "Modifying table 'texts'.\n"; 32 | mysqli_query($it->DB,$query) OR print("- ERROR: Cannot modify database: ".mysqli_error($it->DB)."\n"); 33 | $query = "ALTER TABLE versions ENGINE=InnoDB"; 34 | print "Modifying table 'versions'.\n"; 35 | mysqli_query($it->DB,$query) OR print("- ERROR: Cannot modify database: ".mysqli_error($it->DB)."\n"); 36 | $query = "ALTER TABLE alignments ENGINE=InnoDB"; 37 | print "Modifying table 'alignments'.\n"; 38 | mysqli_query($it->DB,$query) OR print("- ERROR: Cannot modify database: ".mysqli_error($it->DB)."\n"); 39 | 40 | $query = "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='$DB_DATABASE' AND TABLE_NAME LIKE '%_elements' OR TABLE_NAME LIKE '%_links' OR TABLE_NAME LIKE '%_changelog' OR TABLE_NAME LIKE '%_align_changelog'"; 41 | if (!$dbresult = mysqli_query($it->DB,$query)) 42 | die("Cannot access database: ".mysqli_error($it->DB)); 43 | $tables = array(); 44 | while ($ret = mysqli_fetch_assoc($dbresult)) { $tables[] = $ret['TABLE_NAME']; } 45 | 46 | foreach($tables as $table) { 47 | print "Modifying table '$table'.\n"; 48 | if ($DISABLE_FULLTEXT AND substr($table,-9)=='_elements') { 49 | $query = "DROP INDEX index_ft_contents ON $table"; 50 | mysqli_query($it->DB,$query) OR print("- ERROR: Cannot modify database: ".mysqli_error($it->DB)."\n"); 51 | } 52 | if ($DISABLE_FULLTEXT AND preg_match('/[0-9]+_changelog/', $table)) { 53 | $query = "DROP INDEX index_ft_old_contents ON $table"; 54 | mysqli_query($it->DB,$query) OR print("- ERROR: Cannot modify database: ".mysqli_error($it->DB)."\n"); 55 | } 56 | $query = "ALTER TABLE $table ENGINE=InnoDB"; 57 | mysqli_query($it->DB,$query) OR die("- ERROR: Cannot modify database: ".mysqli_error($it->DB)."\n"); 58 | } 59 | 60 | 61 | ?> -------------------------------------------------------------------------------- /users.php: -------------------------------------------------------------------------------- 1 | . 20 | * 21 | */ 22 | 23 | $myurl= $_SERVER['PHP_SELF']; # 'users.php'; 24 | define('WARNING_FORMAT',"

%s

"); 25 | 26 | require 'init.php'; 27 | //# Only ADMIN has access to users.php 28 | //if ($USER['type']!=$USER_ADMIN) { Header('Location: aligner.php'); exit; } 29 | 30 | require 'lib_intertext.php'; 31 | $system = new InterText; 32 | 33 | if (IsSet($_REQUEST['req'])) $req = preg_replace('/[^a-z_]/','',$_REQUEST['req']); 34 | 35 | if ($USER['type']!=$USER_ADMIN) { 36 | if ($req=='') $req='edit'; 37 | $id=$USER['id']; 38 | if ($req!='save' && $req!='edit') { 39 | Header('Location: aligner.php'); exit; 40 | } 41 | } else $id = preg_replace('/[^0-9]/','',$_REQUEST['id']); 42 | 43 | # Processing requests that have to be processed before the HTML starts 44 | switch ($req) { 45 | case 'delete': 46 | $system->user_delete($id); 47 | Header('Location: '.$myurl); 48 | break; 49 | case 'save': 50 | $u = array(); 51 | $u['id'] = $id; 52 | if ($USER['type']==$USER_ADMIN) { 53 | $u['type'] = preg_replace('/[^0-9]/','',$_REQUEST['type']); 54 | $u['firstname'] = $_REQUEST['firstname']; 55 | $u['surname'] = $_REQUEST['surname']; 56 | $u['username'] = $_REQUEST['username']; 57 | } else { 58 | $u['type'] = $USER['type']; 59 | $u['firstname'] = $USER['firstname']; 60 | $u['surname'] = $USER['surname']; 61 | $u['username'] = $USER['username']; 62 | } 63 | $u['password'] = $_REQUEST['passwd']; 64 | if ($u['username']=='') 65 | $WARNING = 'Username cannot be empty!'; 66 | if ($u['surname']=='') 67 | $u['surname']=$u['username']; 68 | if ($u['firstname']=='') 69 | $u['firstname']='???'; 70 | if ($u['id']==0 && $u['password']=='') 71 | $WARNING = 'You have to enter a password for a new user!'; 72 | if ($u['password']!='' && $_REQUEST['passwd1']!=$u['password']) 73 | $WARNING = 'Passwords do not match!'; 74 | foreach ($USERS as $uid => $cu) { 75 | if ($uid==$u['id']) continue; 76 | if ($cu['username']==$u['username']) 77 | $WARNING = 'This username is already in use. Choose another one.'; 78 | } 79 | if ($WARNING!='') 80 | break; 81 | if ($u['password']!='') 82 | $u['password'] = md5($u['password']); 83 | $system->user_save($u); 84 | Header('Location: '.$myurl); 85 | exit; 86 | } 87 | 88 | #### HTML PAGE START #### 89 | require 'header.php'; 90 | 91 | switch ($req) { 92 | case 'edit': 93 | if (IsSet($_REQUEST['id'])) 94 | $u = $USERS[$id]; 95 | else 96 | $u = array('id'=>0, 'type'=>$USER_EDITOR); 97 | case 'save': 98 | # Print menu bar 99 | print "
\n"; 100 | if ($TXTMGR_URL!='') print "[text manager]\n"; 101 | else print " "; 102 | print "[help][logout]\n"; 103 | print "
"; 104 | 105 | print "
\n"; 106 | 107 | # Print a warning 108 | if ($WARNING!='') printf(WARNING_FORMAT,$WARNING); 109 | 110 | $sel = ' selected="selected"'; 111 | ?> 112 |
113 |

User details

114 |
115 |
116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 154 | 157 |
First name:
Surname:
Role: 131 | 136 |
Username:
Password:
152 | (enter password twice for security; if no password is entered, the previous one will be kept) 153 |
155 | 156 |
158 |
159 |
160 |
161 | << Back to the list

'; 164 | else 165 | print '

<< Back

'; 166 | break; 167 | default: 168 | $users = $USERS; 169 | 170 | # Print menu bar 171 | print "
\n"; 172 | print "[text manager]"; 173 | print "[new user]"; 174 | print "[help][logout]\n"; 175 | print "
"; 176 | 177 | print "
\n"; 178 | 179 | # Print a warning 180 | if ($WARNING!='') printf(WARNING_FORMAT,$WARNING); 181 | 182 | print "

Users

\n\n"; 183 | 184 | # $lasttxtid=FALSE; 185 | print "\n"; 186 | $i = 1; 187 | foreach($users as $u) { 188 | if ($u['id']==0) continue; 189 | if ($i % 2) $c="even"; else $c="odd"; 190 | if ($u['type']==$USER_ADMIN) $role='administrator'; 191 | elseif ($u['type']==$USER_RESP) $role='supervisor'; 192 | elseif ($u['type']==$USER_EDITOR) $role='editor'; 193 | print " 194 | "; 195 | $i++; 196 | } 197 | print "
Nameusernamerole 
{$u['name']}{$u['username']}$role\"[DELETE]\"
\n"; 198 | 199 | } 200 | ?> 201 |
202 | 203 | 204 | -------------------------------------------------------------------------------- /users.sql: -------------------------------------------------------------------------------- 1 | USE intertext; 2 | SET CHARACTER SET utf8; 3 | CREATE TABLE `users` ( 4 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 5 | `username` tinytext, 6 | `password` tinytext, 7 | `status` int(10) unsigned DEFAULT NULL, 8 | `name` tinytext, 9 | `surname` tinytext, 10 | PRIMARY KEY (`id`) 11 | ); 12 | 13 | INSERT INTO `users` VALUES 14 | (1,'admin','098f6bcd4621d373cade4e832627b4f6',0,'Admin','Allmighty'), 15 | (2,'resp','098f6bcd4621d373cade4e832627b4f6',1,'Responsible','Supervisor'), 16 | (3,'editor','098f6bcd4621d373cade4e832627b4f6',2,'Any','Editor'); 17 | --------------------------------------------------------------------------------