|
Learning with Texts - Fork 2.4.0-fork
Learn foreign languages with texts
|
All the files needed for a LWT session. More...
Namespaces | |
| namespace | Lwt |
Functions | |
| get_tags ($refresh=0) | |
| get_texttags ($refresh=0) | |
| getTextTitle ($textid) | |
| get_tag_selectoptions ($v, $l) | |
| get_texttag_selectoptions ($v, $l) | |
| get_txtag_selectoptions ($l, $v) | |
| get_archivedtexttag_selectoptions ($v, $l) | |
| saveWordTags ($wid) | |
| saveTextTags ($tid) | |
| saveArchivedTextTags ($tid) | |
| getWordTags ($wid) | |
| getTextTags ($tid) | |
| getArchivedTextTags ($tid) | |
| addtaglist ($item, $list) | |
| addarchtexttaglist ($item, $list) | |
| addtexttaglist ($item, $list) | |
| removetaglist ($item, $list) | |
| removearchtexttaglist ($item, $list) | |
| removetexttaglist ($item, $list) | |
| load_feeds ($currentfeed) | |
| write_rss_to_db ($texts) | |
| print_last_feed_update ($diff) | |
| get_nf_option ($str, $option) | |
| get_links_from_new_feed ($NfSourceURI) | |
| get_links_from_rss ($NfSourceURI, $NfArticleSection) | |
| get_text_from_rsslink ($feed_data, $NfArticleSection, $NfFilterTags, $NfCharset=null) | |
| getPreviousAndNextTextLinks ($textid, $url, $onlyann, $add) | |
| echo_lwt_logo () | |
| getprefixes () | |
| selectmediapath ($f) | |
| selectmediapathoptions ($dir) | |
| get_seconds_selectoptions ($v) | |
| get_playbackrate_selectoptions ($v) | |
| error_message_with_hide ($msg, $noback) | |
| errorbutton ($msg) | |
| remove_soft_hyphens ($str) | |
| limitlength ($s, $l) | |
| replace_supp_unicode_planes_char ($s) | |
| makeCounterWithTotal ($max, $num) | |
| encodeURI ($url) | |
| print_file_path ($filename) | |
| get_file_path ($filename) | |
| get_sepas () | |
| get_first_sepa () | |
| get_mobile_display_mode_selectoptions ($v) | |
| get_sentence_count_selectoptions ($v) | |
| get_words_to_do_buttons_selectoptions ($v) | |
| get_regex_selectoptions ($v) | |
| get_tooltip_selectoptions ($v) | |
| get_themes_selectoptions ($v) | |
| processSessParam ($reqkey, $sesskey, $default, $isnum) | |
| processDBParam ($reqkey, $dbkey, $default, $isnum) | |
| getWordTagList ($wid, $before=' ', $brack=1, $tohtml=1) | |
| get_last_key () | |
| get_checked ($value) | |
| get_selected ($value, $selval) | |
| make_status_controls_test_table ($score, $status, $wordid) | |
| get_languages_selectoptions ($v, $dt) | |
| get_languagessize_selectoptions ($v) | |
| get_wordstatus_radiooptions ($v) | |
| get_wordstatus_selectoptions ($v, $all, $not9899, $off=true) | |
| get_annotation_position_selectoptions ($v) | |
| get_paging_selectoptions ($currentpage, $pages) | |
| get_wordssort_selectoptions ($v) | |
| get_tagsort_selectoptions ($v) | |
| get_textssort_selectoptions ($v) | |
| get_yesno_selectoptions ($v) | |
| get_andor_selectoptions ($v) | |
| get_set_status_option ($n, $suffix="") | |
| get_status_name ($n) | |
| get_status_abbr ($n) | |
| get_colored_status_msg ($n) | |
| get_multiplewordsactions_selectoptions () | |
| get_multipletagsactions_selectoptions () | |
| get_allwordsactions_selectoptions () | |
| get_alltagsactions_selectoptions () | |
| get_multipletextactions_selectoptions () | |
| Returns options for an HTML dropdown to choose a text along a criterion. | |
| get_multiplearchivedtextactions_selectoptions () | |
| get_texts_selectoptions ($lang, $v) | |
| makePager ($currentpage, $pages, $script, $formname) | |
| makeStatusCondition ($fieldname, $statusrange) | |
| checkStatusRange ($currstatus, $statusrange) | |
| makeStatusClassFilter ($status) | |
| makeStatusClassFilterHelper ($status, &$array) | |
| createTheDictLink ($u, $t) | |
| createDictLinksInEditWin ($lang, $word, $sentctljs, $openfirst) | |
| makeOpenDictStr ($url, $txt) | |
| makeOpenDictStrJS ($url) | |
| makeOpenDictStrDynSent ($url, $sentctljs, $txt) | |
| createDictLinksInEditWin2 ($lang, $sentctljs, $wordctljs) | |
| makeDictLinks ($lang, $wordctljs) | |
| createDictLinksInEditWin3 ($lang, $sentctljs, $wordctljs) | |
| checkTest ($val, $name) | |
| strToHex ($string) | |
| strToClassName ($string) | |
| anki_export ($sql) | |
| tsv_export ($sql) | |
| flexible_export ($sql) | |
| mask_term_in_sentence_v2 ($s) | |
| repl_tab_nl ($s) | |
| mask_term_in_sentence ($s, $regexword) | |
| textwordcount ($textID) | |
| texttodocount ($text) | |
| texttodocount2 ($textid) | |
| getSentence ($seid, $wordlc, $mode) | |
| get20Sentences ($lang, $wordlc, $wid, $jsctlname, $mode) | |
| areUnknownWordsInSentence ($sentno) | |
| get_languages () | |
| getLanguage ($lid) | |
| getScriptDirectionTag ($lid) | |
| insertExpressionFromMeCab ($textlc, $lid, $wid, $len, $mode) | |
| new_expression_interactable ($hex, $appendtext, $sid, $len) | |
| insertExpressions ($textlc, $lid, $wid, $len, $mode) | |
| restore_file ($handle, $title) | |
| recreate_save_ann ($textid, $oldann) | |
| create_ann ($textid) | |
| insert_prefix_in_sql ($sql_line) | |
| create_save_ann ($textid) | |
| process_term ($nonterm, $term, $trans, $wordid, $line) | |
| get_first_translation ($trans) | |
| get_annotation_link ($textid) | |
| trim_value (&$value) | |
| refreshText ($word, $tid) | |
| makeVideoPlayer ($path, $offset=0) | |
| makeAudioPlayer ($audio, $offset=0) | |
| framesetheader ($title) | |
| pagestart ($title, $close) | |
| pagestart_nobody ($title, $addcss='') | |
All the files needed for a LWT session.
By requiring this file, you start a session, connect to the database and declare a lot of useful functions.
| anki_export | ( | $sql | ) |
| createTheDictLink | ( | $u, | |
| $t | |||
| ) |
Create and verify a dictionary URL link
| string | $u | Dictionary URL. It may contain ### that will get parsed |
| string | $t | Text that substite the ### |
| echo_lwt_logo | ( | ) |
Return an HTML formatted logo of the application.
@global string $tbpref Table name prefix (optional)
| flexible_export | ( | $sql | ) |
| framesetheader | ( | $title | ) |
Echo a HEAD tag for using with frames
| string | $title | Title to use |
| get_checked | ( | $value | ) |
If $value is true, return an HTML-style checked attribute.
| mixed | $value | Some value that can be evaluated as a boolean |
| get_file_path | ( | $filename | ) |
Get the path of a file using the theme directory
| string | $filename | Filename |
| get_languages | ( | ) |
Return a dictionary of languages name - id
| get_last_key | ( | ) |
Return the last inserted ID in the database
| get_links_from_new_feed | ( | $NfSourceURI | ) |
@psalm-return array<'feed_text'|'feed_title'|int, array{title: null|string, desc: null|string, link: string, encoded?: false|string, description?: false|string, content?: false|string, text?: mixed}|null|string>|false
| get_links_from_rss | ( | $NfSourceURI, | |
| $NfArticleSection | |||
| ) |
@psalm-return false|list<array{title: null|string, desc: null|string, link: string, date: string, text?: false|string, audio: string}>
| get_mobile_display_mode_selectoptions | ( | $v | ) |
Prepare options for mobile.
| "0"|"1"|"2" | $v Current mobile type |
| get_selected | ( | $value, | |
| $selval | |||
| ) |
Return an HTML attribute if $value is equal to $selval.
| get_tags | ( | $refresh = 0 | ) |
Return the list of all tags.
| int | $refresh | If true, refresh all tags for session |
@global string $tbpref Table name prefix
| get_text_from_rsslink | ( | $feed_data, | |
| $NfArticleSection, | |||
| $NfFilterTags, | |||
$NfCharset = null |
|||
| ) |
@psalm-suppress NullIterator
| get_texttags | ( | $refresh = 0 | ) |
Return the list of all text tags.
| int | $refresh | If true, refresh all text tags for session |
@global string $tbpref Table name prefix
| getLanguage | ( | $lid | ) |
Get language name from its ID
| string | $lid | Language ID |
| getprefixes | ( | ) |
Return all different database prefixes that are in use.
@psalm-return list<false|string>
| getPreviousAndNextTextLinks | ( | $textid, | |
| $url, | |||
| $onlyann, | |||
| $add | |||
| ) |
Return navigation arrows to previous and next texts.
| int | $textid | ID of the current text |
| string | $url | Base URL to append before $textid |
| bool | $onlyann | Restrict to annotated texts only |
| string | $add | Some content to add before the output |
| getSentence | ( | $seid, | |
| $wordlc, | |||
| $mode | |||
| ) |
| insertExpressionFromMeCab | ( | $textlc, | |
| $lid, | |||
| $wid, | |||
| $len, | |||
| $mode | |||
| ) |
Insert an expression to the database using MeCab.
| string | $textlc | |
| string | $lid | Language ID |
| string | $wid | Word ID |
| int | $mode |
@global string $tbpref Table name prefix
| insertExpressions | ( | $textlc, | |
| $lid, | |||
| $wid, | |||
| $len, | |||
| $mode | |||
| ) |
Alter the database when to add a new word
| string | $textlc | |
| string | $lid | Language ID |
| string | $len | |
| int | $mode | Function mode
|
| make_status_controls_test_table | ( | $score, | |
| $status, | |||
| $wordid | |||
| ) |
Make the plus and minus controls in a test table for a word.
| int | $score | Score associated to this word |
| int | $status | Status for this word |
| int | $wordid | Word ID |
| makeAudioPlayer | ( | $audio, | |
$offset = 0 |
|||
| ) |
Create an HTML audio player.
| string | $audio | Audio URL |
| int | $offset | Offset from the beginning of the video |
Get the extension of a file.
| {string} | file File path |
Import audio data when jPlayer is ready.
Prepare media interactions with jPlayer.
| makeStatusClassFilter | ( | $status | ) |
Adds HTML attributes to create a filter over words learning status.
| int<0,5>|98|99|599 | $status Word learning status 599 is a special status combining 5 and 99 statuses. 0 return an empty string |
| makeStatusClassFilterHelper | ( | $status, | |
| & | $array | ||
| ) |
Replace $status in $array by -1
| int | $status | A value in $array |
| int[] | $array | Any array of values |
| makeVideoPlayer | ( | $path, | |
$offset = 0 |
|||
| ) |
Create an embed video player
| string | $path | URL or local file path |
| int | $offset | Offset from the beginning of the video |
| new_expression_interactable | ( | $hex, | |
| $appendtext, | |||
| $sid, | |||
| $len | |||
| ) |
Prepare a JavaScript dialog to insert a new expression
| pagestart | ( | $title, | |
| $close | |||
| ) |
Write a page header and start writing its body.
| string | $title | Title of the page |
| bool | $close | Set to true if you are closing the header; |
@global bool $debug Show a DEBUG span if true
| pagestart_nobody | ( | $title, | |
$addcss = '' |
|||
| ) |
Start a standard page with a complete header and a non-closed body.
| string | $title | Title of the page |
| string | $addcss | Some CSS to be embed in a style tag |
@global string $tbpref The database table prefix if true @global int $debug Show the requests if true
| print_file_path | ( | $filename | ) |
Echo the path of a file using the theme directory. Echo the base file name of file is not found
| string | $filename | Filename |
| refreshText | ( | $word, | |
| $tid | |||
| ) |
Refresh a text.
| repl_tab_nl | ( | $s | ) |
Replace all white space characters by a simple space ' '. The output string is also trimmed.
| string | $s | String to parse |
| saveArchivedTextTags | ( | $tid | ) |
Save the tags for archived texts.
| saveTextTags | ( | $tid | ) |
Save the tags for texts.
| saveWordTags | ( | $wid | ) |
Save the tags for words.
| selectmediapath | ( | $f | ) |
Select the path for a media (audio or video).
| string | $f | Previous media file URI |
| selectmediapathoptions | ( | $dir | ) |
Get the dirrent options to dsplay as acceptable media files.
| string | $dir | Directory containing files |
| strToClassName | ( | $string | ) |
Escapes everything to "¤xx" but not 0-9, a-z, A-Z, and unicode >= (hex 00A5, dec 165)
| string | $string | String to escape |
| texttodocount2 | ( | $textid | ) |
Print the number of words left to do in this text.
| string | int | $textid | Text ID |
@global string $tbpref Table prefix
| textwordcount | ( | $textID | ) |
Compute and echo word statistics about a specific text ID.
It is useful for unknown percent with this fork.
The echo is an output array{0: int, 1: int, 2: int, 3: int, 4: int, 5: int} Total number of words, number of expression, statistics, total unique, number of unique expressions, unique statistics
| string | $textID | identifier for this text |
@global string $tbpref Table name prefix
| trim_value | ( | & | $value | ) |
Like trim, but in place (modify variable)
| string | $value | Value to be trimmed |
| tsv_export | ( | $sql | ) |