| 1 |
<?php |
<?php |
| 2 |
// $Id: $ |
// $Id: t9nlinks.module,v 1.1 2009/01/09 06:27:39 bevan Exp $ |
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 5 |
* Creates links to translations in convenient places for semi-multi-lingual sites, such as next to teaser titles, as local tasks (aka tabs) and on node/edit pages. |
* Creates links to translations in convenient places for semi-multi-lingual sites, such as next to teaser titles, as local tasks (aka tabs) and on node/edit pages. |
| 16 |
$items = array(); |
$items = array(); |
| 17 |
|
|
| 18 |
// Create menu items for each enabled language. Most get hidden dynamically by the access callback. |
// Create menu items for each enabled language. Most get hidden dynamically by the access callback. |
| 19 |
foreach (locale_language_list() as $langcode => $language) { |
foreach (locale_language_list('native') as $langcode => $language) { |
| 20 |
// Node VIEW menu items, to view nodes by language. |
// Node VIEW menu items, to view nodes by language. |
| 21 |
$items["node/%node/view/t9n-$langcode"] = array( |
$items["node/%node/view/t9n-$langcode"] = array( |
| 22 |
'title' => $language, |
'title' => $language, |
| 142 |
if (!empty($t9ns)) { |
if (!empty($t9ns)) { |
| 143 |
// Add css for the styling of the links. |
// Add css for the styling of the links. |
| 144 |
drupal_add_css(drupal_get_path('module', 't9nlinks') . '/theme/node-teaser-title-links.css'); |
drupal_add_css(drupal_get_path('module', 't9nlinks') . '/theme/node-teaser-title-links.css'); |
|
if (module_exists('themer')) { |
|
|
// This CSS is dependendant on an HTC file callback provided by Themer module. |
|
|
drupal_add_css(drupal_get_path('module', 't9nlinks') . '/theme/node-teaser-title-links-ie-border-radius.css'); |
|
|
} |
|
| 145 |
|
|
| 146 |
// Get language names by language code, and unique indices ($ids) per language code. |
// Get language names by language code, and unique indices ($ids) per language code. |
| 147 |
$languages = language_list(); |
$languages = language_list(); |