/includes/functions_rtl.php

Description

RTL Functions

The functions in this file are common to all PGV pages and include date conversion routines and sorting functions.

phpGedView: Genealogy Viewer Copyright (C) 2002 to 2003 John Finlay and Others

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

  • version: $Id: functions_rtl.php 981 2007-03-21 13:24:38Z fisharebest $
Functions
begRTLText (line 400)

Verify if text starts by a RtL character

This will verify if text starts by a RtL character

void begRTLText (string $text)
  • string $text: to verify
bidi_text (line 272)

process a string according to bidirectional rules

this function will take a text string and reverse it for RTL languages according to bidi rules.

  • return: the new bidi string
  • todo: add other RTL langauges
string bidi_text (string $text)
  • string $text: String to change
endRTLText (line 416)

Verify if text ends by a RtL character

This will verify if text ends by a RtL character

void endRTLText (string $text)
  • string $text: to verify
hasLTRText (line 453)

Verify if text is LtR

This will verify if text has LtR characters that are not special characters

void hasLTRText (string $text)
  • string $text: to verify
hasRTLText (line 432)

Verify if text is RtL

This will verify if text has RtL characters

void hasRTLText (string $text)
  • string $text: to verify
ltr_string (line 200)

Force a string in ltr direction

This function returns a string in left-to-right direction. To be used for non HTML string output (e.g. GD ImageTtfText function).

  • return: ltr string
  • todo: more hebrew controls (check numbers or ‏ tags)
  • todo: other rtl languages
  • author: opus27
string ltr_string (string $name)
  • string $name: input string
oneRTLText (line 383)

Verify if text is a RtL character

This will verify if text is a RtL character

void oneRTLText (string $text)
  • string $text: to verify
ord_UTF8 (line 99)

Get ordinal value of input character

This function accepts a UTF-8 multibyte input character and returns its ordinal value.

  • return: Ordinal value of input character
number ord_UTF8 (string $letter)
  • string $letter: Input character
unhtmlentities (line 252)

convert HTML entities to to their original characters

original found at http://www.php.net/manual/en/function.get-html-translation-table.php

string unhtmlentities (string $string)
  • string $string: the string to remove the entities from
useRTLFunctions (line 86)

Use RTL functions

this function returns true if the gedcom config $USE_RTL_FUNCTIONS is set to true. This is intended to cut down on unneeded processing for users who do not need RTL functionality.

  • return: if to process RTL specific text processing.
  • todo: Possibly return true if the users current lang is RTl even if the setting is set to false;
true useRTLFunctions ()
whatAlphabet (line 123)

Determine alphabet of input character

This function inspects the input character to determine which alphabet it belongs to. The test for Vietnamese is not 100% accurate, since Vietnamese borrows from the French alphabet. This results in some Vietnamese characters being identified as "other".

  • return: Name of the alphabet
string whatAlphabet (string $char)
  • string $char: Input character
whatLanguage (line 151)

Determine language of input string

This function inspects the input string to determine its language. Except for Vietnamese, when the input string contains characters from more than one alphabet, this function will return "other". For Vietnamese, if any characters of the input string are "vietnamese" and the only other characters are of language "other", the result is "vietnamese".

  • return: Name of the language
string whatLanguage (string $string)
  • string $string: Input string

Documentation generated on Wed, 28 Mar 2007 09:54:20 -0600 by phpDocumentor 1.3.1