summaryrefslogtreecommitdiff
path: root/modules/book
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-02 19:26:23 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-02 19:26:23 +0000
commit0baad49d620d9988837287cb5942eea764d3ed6f (patch)
tree146072f69b433cb7922572ba2ac627a83987edd4 /modules/book
parentef4513651e210784ba84eb310cf919e26f668bed (diff)
downloadbrdo-0baad49d620d9988837287cb5942eea764d3ed6f.tar.gz
brdo-0baad49d620d9988837287cb5942eea764d3ed6f.tar.bz2
- Patch #635094 by plach: unify 'language neutral' language codes.
Diffstat (limited to 'modules/book')
-rw-r--r--modules/book/book.admin.inc4
-rw-r--r--modules/book/book.module8
-rw-r--r--modules/book/book.pages.inc6
-rw-r--r--modules/book/book.test12
4 files changed, 15 insertions, 15 deletions
diff --git a/modules/book/book.admin.inc b/modules/book/book.admin.inc
index 81a07637f..52e67d36e 100644
--- a/modules/book/book.admin.inc
+++ b/modules/book/book.admin.inc
@@ -72,7 +72,7 @@ function book_admin_settings_validate($form, &$form_state) {
* @ingroup forms.
*/
function book_admin_edit($form, $form_state, $node) {
- drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']);
+ drupal_set_title($node->title[LANGUAGE_NONE][0]['value']);
$form['#node'] = $node;
_book_admin_table($node, $form);
$form['save'] = array(
@@ -125,7 +125,7 @@ function book_admin_edit_submit($form, &$form_state) {
// Update the title if changed.
if ($row['title']['#default_value'] != $values['title']) {
$node = node_load($values['nid'], FALSE);
- $langcode = FIELD_LANGUAGE_NONE;
+ $langcode = LANGUAGE_NONE;
$node->title = array($langcode => array(array('value' => $values['title'])));
$node->book['link_title'] = $values['title'];
$node->revision = 1;
diff --git a/modules/book/book.module b/modules/book/book.module
index a653261d3..bcb0682db 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -501,7 +501,7 @@ function _book_add_form_elements(&$form, &$form_state, $node) {
if (isset($node->nid) && ($nid == $node->book['original_bid']) && ($node->book['parent_depth_limit'] == 0)) {
// This is the top level node in a maximum depth book and thus cannot be moved.
- $options[$node->nid] = $node->title[FIELD_LANGUAGE_NONE][0]['value'];
+ $options[$node->nid] = $node->title[LANGUAGE_NONE][0]['value'];
}
else {
foreach (book_get_books() as $book) {
@@ -550,7 +550,7 @@ function _book_update_outline($node) {
$new = empty($node->book['mlid']);
$node->book['link_path'] = 'node/' . $node->nid;
- $node->book['link_title'] = $node->title[FIELD_LANGUAGE_NONE][0]['value'];
+ $node->book['link_title'] = $node->title[LANGUAGE_NONE][0]['value'];
$node->book['parent_mismatch'] = FALSE; // The normal case.
if ($node->book['bid'] == $node->nid) {
@@ -906,7 +906,7 @@ function book_form_node_delete_confirm_alter(&$form, $form_state) {
if (isset($node->book) && $node->book['has_children']) {
$form['book_warning'] = array(
- '#markup' => '<p>' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'])) . '</p>',
+ '#markup' => '<p>' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->title[LANGUAGE_NONE][0]['value'])) . '</p>',
'#weight' => -10,
);
}
@@ -1129,7 +1129,7 @@ function book_node_export($node, $children = '') {
*/
function template_preprocess_book_node_export_html(&$variables) {
$variables['depth'] = $variables['node']->book['depth'];
- $variables['title'] = check_plain($variables['node']->title[FIELD_LANGUAGE_NONE][0]['value']);
+ $variables['title'] = check_plain($variables['node']->title[LANGUAGE_NONE][0]['value']);
$variables['content'] = $variables['node']->rendered;
}
diff --git a/modules/book/book.pages.inc b/modules/book/book.pages.inc
index 76454aa9f..4fab15465 100644
--- a/modules/book/book.pages.inc
+++ b/modules/book/book.pages.inc
@@ -79,7 +79,7 @@ function book_export_html($nid) {
$contents = book_export_traverse($tree, 'book_node_export');
}
- return theme('book_export_html', array('title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'], 'contents' => $contents, 'depth' => $node->book['depth']));
+ return theme('book_export_html', array('title' => $node->title[LANGUAGE_NONE][0]['value'], 'contents' => $contents, 'depth' => $node->book['depth']));
}
else {
drupal_access_denied();
@@ -90,7 +90,7 @@ function book_export_html($nid) {
* Menu callback; show the outline form for a single node.
*/
function book_outline($node) {
- drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']);
+ drupal_set_title($node->title[LANGUAGE_NONE][0]['value']);
return drupal_get_form('book_outline_form', $node);
}
@@ -188,7 +188,7 @@ function book_outline_form_submit($form, &$form_state) {
*/
function book_remove_form($form, &$form_state, $node) {
$form['#node'] = $node;
- $title = array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value']);
+ $title = array('%title' => $node->title[LANGUAGE_NONE][0]['value']);
if ($node->book['has_children']) {
$description = t('%title has associated child pages, which will be relocated automatically to maintain their connection to the book. To recreate the hierarchy (as it was before removing this page), %title may be added again using the Outline tab, and each of its former child pages will need to be relocated manually.', $title);
diff --git a/modules/book/book.test b/modules/book/book.test
index 9a0f9a476..c051e73fb 100644
--- a/modules/book/book.test
+++ b/modules/book/book.test
@@ -110,7 +110,7 @@ class BookTestCase extends DrupalWebTestCase {
// Check previous, up, and next links.
if ($previous) {
- $this->assertRaw(l('‹ ' . $previous->title[FIELD_LANGUAGE_NONE][0]['value'], 'node/' . $previous->nid, array('attributes' => array('class' => array('page-previous'), 'title' => t('Go to previous page')))), t('Previous page link found.'));
+ $this->assertRaw(l('‹ ' . $previous->title[LANGUAGE_NONE][0]['value'], 'node/' . $previous->nid, array('attributes' => array('class' => array('page-previous'), 'title' => t('Go to previous page')))), t('Previous page link found.'));
}
if ($up) {
@@ -118,7 +118,7 @@ class BookTestCase extends DrupalWebTestCase {
}
if ($next) {
- $this->assertRaw(l($next->title[FIELD_LANGUAGE_NONE][0]['value'] . ' ›', 'node/' . $next->nid, array('attributes' => array('class' => array('page-next'), 'title' => t('Go to next page')))), t('Next page link found.'));
+ $this->assertRaw(l($next->title[LANGUAGE_NONE][0]['value'] . ' ›', 'node/' . $next->nid, array('attributes' => array('class' => array('page-next'), 'title' => t('Go to next page')))), t('Next page link found.'));
}
// Compute the expected breadcrumb.
@@ -140,8 +140,8 @@ class BookTestCase extends DrupalWebTestCase {
// Check printer friendly version.
$this->drupalGet('book/export/html/' . $node->nid);
- $this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'], t('Printer friendly title found.'));
- $this->assertRaw(check_markup($node->body[FIELD_LANGUAGE_NONE][0]['value'], $node->body[FIELD_LANGUAGE_NONE][0]['format']), t('Printer friendly body found.'));
+ $this->assertText($node->title[LANGUAGE_NONE][0]['value'], t('Printer friendly title found.'));
+ $this->assertRaw(check_markup($node->body[LANGUAGE_NONE][0]['value'], $node->body[LANGUAGE_NONE][0]['format']), t('Printer friendly body found.'));
$number++;
}
@@ -154,7 +154,7 @@ class BookTestCase extends DrupalWebTestCase {
function generateOutlinePattern($nodes) {
$outline = '';
foreach ($nodes as $node) {
- $outline .= '(node\/' . $node->nid . ')(.*?)(' . $node->title[FIELD_LANGUAGE_NONE][0]['value'] . ')(.*?)';
+ $outline .= '(node\/' . $node->nid . ')(.*?)(' . $node->title[LANGUAGE_NONE][0]['value'] . ')(.*?)';
}
return '/<div id="book-navigation-' . $this->book->nid . '"(.*?)<ul(.*?)' . $outline . '<\/ul>/s';
@@ -172,7 +172,7 @@ class BookTestCase extends DrupalWebTestCase {
static $number = 0; // Used to ensure that when sorted nodes stay in same order.
$edit = array();
- $langcode = FIELD_LANGUAGE_NONE;
+ $langcode = LANGUAGE_NONE;
$edit["title[$langcode][0][value]"] = $number . ' - SimpleTest test node ' . $this->randomName(10);
$edit["body[$langcode][0][value]"] = 'SimpleTest test body ' . $this->randomName(32) . ' ' . $this->randomName(32);
$edit['book[bid]'] = $book_nid;