Class ModRewrite

Description

Class to create websafe names

TODO: Adapt to PHP 5 coding standards...

  • author: Stefan Seifarth / stese

Located in /contenido/plugins/mod_rewrite/classes/class.modrewrite.php (line 41)


	
			
Method Summary
 ModRewrite ModRewrite ()
 string build_new_url ([string $str_args = ""], [ $str_xhtml = true])
 string build_recursiv_path ([integer $int_id = 0], [ $int_lang_id = 0], [ $int_lastid = 0])
 string contenido_html_anchor ([array $arr_matches = array()], [ $str_xhtml = true])
 array get_artids ([integer $int_id = 0])
 string get_arttitle ([int $int_id = 0], [int $int_lang_id = 0])
 string get_art_lang_websafename ([integer $int_id = 0])
 string get_art_websafename ([integer $int_id = 0], [integer $int_lang_id = 0])
 string get_catname ([int $int_id = 0], [int $int_lang_id = 0])
 array get_cat_languages ([int $int_id = 0])
 array get_client_full_url_parts (string $url)
 string get_client_name ([int $clientId = 0])
 array get_id_from_idartlang ([int $int_id = 0])
 mixed get_id_from_pathresolver_result (array $results)
 string get_language_name ([int $languageId = 0])
 bool in_articles ([string $str_name = ""], [int $int_id = 0], [int $int_lang_id = 0], [ $int_idcat = 0])
 bool in_category ([string $str_name = ""], [int $int_id = 0], [int $int_lang_id = 0])
 bool is_enabled ()
 void reset_aliases ()
 string rewrite_html_anchor ([array $arr_matches = array()])
 bool set_article ([string $str_name = ""], [int $int_id = 0], [int $int_lang_id = 0], [ $int_idcat = 0])
 bool set_category ([string $str_name = ""], [int $int_id = 0], [int $int_lang_id = 0])
Methods
Constructor ModRewrite (line 46)

Constructor Function

ModRewrite ModRewrite ()
build_new_url (line 511)

build_new_url()

build new url from given arguments

get querystring of front_content.php and convert this url to the new mod_rewrite url method will be startet before the complete output of the front site will be executed

  • return: new url
  • deprecated: Functionaliy will be managed by Contenido_UrlBuilder_MR Is no more used and should removed, Murat Purc
string build_new_url ([string $str_args = ""], [ $str_xhtml = true])
  • string $str_args: given arguments
  • $str_xhtml
build_recursiv_path (line 385)

build_recursiv_path()

build a recursiv path for mod_rewrite rule like server directories ( dir1/dir2/dir3 )

  • return: linkpath with correct uri
string build_recursiv_path ([integer $int_id = 0], [ $int_lang_id = 0], [ $int_lastid = 0])
  • integer $int_id: latest category id
  • $int_lang_id
  • $int_lastid
contenido_html_anchor (line 477)

return full contenido url from single anchor

  • return: new anchor
string contenido_html_anchor ([array $arr_matches = array()], [ $str_xhtml = true])
  • array $arr_matches: [0] = complete anchor, [1] = pre arguments, [2] = anchor name, [3] = post arguments
  • $str_xhtml
get_artids (line 366)

get_artids()

get article title, language id

  • return: title, idlang
array get_artids ([integer $int_id = 0])
  • integer $int_id: idartlang
get_arttitle (line 311)

Get article name from article id and language id

  • return: Article name
string get_arttitle ([int $int_id = 0], [int $int_lang_id = 0])
  • int $int_id: Article id
  • int $int_lang_id: Language id
get_art_lang_websafename (line 738)

get_art_lang_websafename()

get article websafe name from idartlang

  • return: article websafe name
string get_art_lang_websafename ([integer $int_id = 0])
  • integer $int_id: idartlang
get_art_websafename (line 720)

get_art_websafename()

get article websafe name from article id and language id

  • return: article websafe name
string get_art_websafename ([integer $int_id = 0], [integer $int_lang_id = 0])
  • integer $int_id: article id
  • integer $int_lang_id: language id
get_catname (line 280)

Get category name from category id and language id.

  • return: Category name
string get_catname ([int $int_id = 0], [int $int_lang_id = 0])
  • int $int_id: Category id
  • int $int_lang_id: Language id
get_cat_languages (line 331)

Get language ids from category id

  • return: Used language ids
array get_cat_languages ([int $int_id = 0])
  • int $int_id: Category id
get_client_full_url_parts (line 814)

get_client_full_url_parts() Splits passed argument into scheme://host and path/query.

Example: input = http://host/front_content.php?idcat=123 return = array('htmlpath' => 'http://host', 'url' => 'front_content.php?idcat=123')

  • return: Assoziative array including the two parts:
    • array('htmlpath' => $path, 'url' => $url)
array get_client_full_url_parts (string $url)
  • string $url: URL to split
get_client_name (line 754)

Get name of client by id

  • return: Client name
string get_client_name ([int $clientId = 0])
  • int $clientId: Client id
get_id_from_idartlang (line 260)

Get article id and language id from article language id

  • return: Array with idart and idlang of current article
array get_id_from_idartlang ([int $int_id = 0])
  • int $int_id: Current article id
get_id_from_pathresolver_result (line 917)

Used to postprocess resolved path

Error site handling if category not found

if percentage == 100 and there is no 100 percentage result value, error site will be shown - can be adjust by user settings for smooth similar effects - 80 to 95 will be best but have to check by user

  • return: Categoryid or false
mixed get_id_from_pathresolver_result (array $results)
  • array $results: Pathresolver results array
get_language_name (line 781)

Returns name of language by id

  • return: Lanuage name
string get_language_name ([int $languageId = 0])
  • int $languageId: Language id
in_articles (line 110)

Check articles on websafe name.

Check all articles in the current category on existing same websafe name.

  • return: True if websafename already exists, false if not
bool in_articles ([string $str_name = ""], [int $int_id = 0], [int $int_lang_id = 0], [ $int_idcat = 0])
  • string $str_name: Websafe name to check
  • int $int_id: Current article id
  • int $int_lang_id: Current language id
  • $int_idcat
in_category (line 71)

Check categories on websafe name

Check all categories in the main parent category on existing same websafe name

  • return: True if websafename already exists, false if not
bool in_category ([string $str_name = ""], [int $int_id = 0], [int $int_lang_id = 0])
  • string $str_name: Websafe name to check
  • int $int_id: Current category id
  • int $int_lang_id: Current language id
is_enabled (line 56)

Returns enabled state of mod rewrite plugin

bool is_enabled ()
reset_aliases (line 899)

reset_aliases()

method to reset all aliases (category and article)

void reset_aliases ()
reset_articles_aliases (line 873)

reset_articles_aliases()

method to reset all aliases in articles

void reset_articles_aliases ()
reset_categories_aliases (line 847)

reset_categories_aliases()

method to reset all aliases in categories

void reset_categories_aliases ()
rewrite_html_anchor (line 431)

return full contenido url from single anchor

  • return: new anchor
string rewrite_html_anchor ([array $arr_matches = array()])
  • array $arr_matches: [0] = complete anchor, [1] = pre arguments, [2] = anchor name, [3] = post arguments
set_article (line 154)

Set websafe name in article list.

Insert new websafe name in article list

  • return: True if insert was successfully
bool set_article ([string $str_name = ""], [int $int_id = 0], [int $int_lang_id = 0], [ $int_idcat = 0])
  • string $str_name: Original name (will be converted)
  • int $int_id: Current article id
  • int $int_lang_id: Current language id
  • $int_idcat
set_category (line 211)

Set websafe name in category list.

Insert new websafe name in category list.

  • return: True if insert was successfully
bool set_category ([string $str_name = ""], [int $int_id = 0], [int $int_lang_id = 0])
  • string $str_name: Original name (will be converted) or alias
  • int $int_id: Current article id
  • int $int_lang_id: Current language id
validate_setting_categories_as_html (line 937)

Analyses the settings for usage of categories as a html file and returns the result as a boolean

  • return: True if settings are active and valid otherwhise false.
bool validate_setting_categories_as_html ()

Documentation generated on Tue, 12 Aug 2008 00:06:14 +0200 by phpDocumentor 1.4.0