Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
315
Merge Requests
315
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
83228839
Commit
83228839
authored
Jun 07, 2009
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#480412
by JamesAn: converted to drupal_static().
parent
eb0839b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
modules/book/book.module
modules/book/book.module
+3
-3
modules/book/book.test
modules/book/book.test
+4
-0
No files found.
modules/book/book.module
View file @
83228839
...
...
@@ -294,7 +294,7 @@ function theme_book_title_link($link) {
* the options for a form select.
*/
function
book_get_books
()
{
static
$all_books
;
$all_books
=
&
drupal_static
(
__FUNCTION__
)
;
if
(
!
isset
(
$all_books
))
{
$all_books
=
array
();
...
...
@@ -580,7 +580,7 @@ function book_update_bid($book_link) {
* immediately after it in the array.
*/
function
book_get_flat_menu
(
$book_link
)
{
static
$flat
=
array
(
);
$flat
=
&
drupal_static
(
__FUNCTION__
,
array
()
);
if
(
!
isset
(
$flat
[
$book_link
[
'mlid'
]]))
{
// Call menu_tree_all_data() to take advantage of the menu system's caching.
...
...
@@ -1144,7 +1144,7 @@ function book_link_load($mlid) {
* An subtree of menu links in an array, in the order they should be rendered.
*/
function
book_menu_subtree_data
(
$item
)
{
static
$tree
=
array
(
);
$tree
=
&
drupal_static
(
__FUNCTION__
,
array
()
);
// Generate a cache ID (cid) specific for this $menu_name and $item.
$cid
=
'links:'
.
$item
[
'menu_name'
]
.
':subtree-cid:'
.
$item
[
'mlid'
];
...
...
modules/book/book.test
View file @
83228839
...
...
@@ -95,6 +95,8 @@ class BookTestCase extends DrupalWebTestCase {
* The nodes that should be displayed in the breadcrumb.
*/
function
checkBookNode
(
$node
,
$nodes
,
$previous
=
FALSE
,
$up
=
FALSE
,
$next
=
FALSE
,
array
$breadcrumb
)
{
// $number does not use drupal_static as it should not be reset
// since it uniquely identifies each call to checkBookNode().
static
$number
=
0
;
$this
->
drupalGet
(
'node/'
.
$node
->
nid
);
...
...
@@ -166,6 +168,8 @@ class BookTestCase extends DrupalWebTestCase {
* @param integer $parent Parent book reference id.
*/
function
createBookNode
(
$book_nid
,
$parent
=
NULL
)
{
// $number does not use drupal_static as it should not be reset
// since it uniquely identifies each call to createBookNode().
static
$number
=
0
;
// Used to ensure that when sorted nodes stay in same order.
$edit
=
array
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment