funcs.php File Reference

Go to the source code of this file.

Namespaces

namespace  docbook

Functions

 file_content_xml ($xml_path=WS_BOOKS, $node_path=UNDEFINED, $lng=UNDEFINED)
 Returns the path of the content.xml for the given node and language.
 file_content_html ($cache_path=WS_CACHE, $node_path=UNDEFINED, $lng=UNDEFINED)
 Returns the path of the content_lng.html for the given node and language.
 process_index ($transformer, $arr_params=array(), $books=UNDEFINED, $lng=UNDEFINED)
 applies the given transformer to index.xml
 get_arr_navigation ($node_path, $cache_path=UNDEFINED, $lng=UNDEFINED)
 Reads from cache 'navigation.txt' for the given node and returns an associative array with the template variables this_path, next_path, prev_path, up_path, this_title, next_title, prev_title, up_title.
 update_cache ($public='workspace', $node_path=UNDEFINED, $lng=UNDEFINED)
 Update the cache file content.html from content.xml.
 get_state_filename ()
 Returns the file state.txt of the current node.
 get_node_state ()
 Reads the file state.txt of the current node and returns an associative array with the variables found in it.
 write_node_state ($arr_state)
 set_node_status ($new_status)
 Set the status of the current node to the given new status.
 set_node_lock ($lock, $mode)
 Lock or unlock the current node.
 locked_by_somebody ($arr_state=UNDEFINED)
 Returns true and displays a notification message, if the node is locked by another user.
 is_locked ($arr_state)
 Returns true if the node is locked and the lock has not expired.
 get_date_str ($timestamp)
 Converts the given time stamp to a date string.
 book_fixed_to_tag ($book_id, $lng)
 Check whether the public copy of the book is fixed to a certain tag or revision and return it.


Function Documentation

file_content_xml ( xml_path = WS_BOOKS,
node_path = UNDEFINED,
lng = UNDEFINED 
)

Returns the path of the content.xml for the given node and language.

Definition at line 37 of file funcs.php.

References $book_id, and $lng.

Referenced by revisions::add_rev_diff(), revisions::add_rs_revs(), changeid_setid(), approve::get_content_diff(), revisions::get_revision(), approve::get_svn_status(), approve::non_recursive_commit(), approve::non_recursive_revert(), edit::on_change_title(), revisions::on_save(), edit_content::on_save(), edit_content::onRender(), approve::recursive_commit(), and approve::recursive_revert().

file_content_html ( cache_path = WS_CACHE,
node_path = UNDEFINED,
lng = UNDEFINED 
)

Returns the path of the content_lng.html for the given node and language.

Definition at line 61 of file funcs.php.

References $book_id, and $lng.

process_index ( transformer,
arr_params = array(),
books = UNDEFINED,
lng = UNDEFINED 
)

applies the given transformer to index.xml

Definition at line 81 of file funcs.php.

References $book_id, $lng, and shell().

Referenced by change_id_validate(), edit::on_add_subnode(), docbook::on_set_node_id(), process_index_node(), transform_index(), update_navigation(), and update_subnodes_html().

get_arr_navigation ( node_path,
cache_path = UNDEFINED,
lng = UNDEFINED 
)

Reads from cache 'navigation.txt' for the given node and returns an associative array with the template variables this_path, next_path, prev_path, up_path, this_title, next_title, prev_title, up_title.

Definition at line 118 of file funcs.php.

References $book_id, and $lng.

Referenced by changeid_updatecache(), get_id_title(), edit::on_delete(), docbook::onRender(), update_cache_files(), update_cache_files_all_langs(), updatenavig_movedown(), and updatenavig_moveup().

update_cache ( public = 'workspace',
node_path = UNDEFINED,
lng = UNDEFINED 
)

Update the cache file content.html from content.xml.

Definition at line 159 of file funcs.php.

References $book_id, $lng, shell(), and write_file().

Referenced by approve::non_recursive_commit(), approve::non_recursive_revert(), revisions::on_save(), and edit_content::on_save().

get_state_filename (  ) 

Returns the file state.txt of the current node.

Definition at line 196 of file funcs.php.

References $book_id, and $lng.

Referenced by get_node_state(), and write_node_state().

get_node_state (  ) 

Reads the file state.txt of the current node and returns an associative array with the variables found in it.

This file contains two lines. The first line is the lock line and contains 'lock:mode:l_user:l_email:l_timestamp', where lock is 'locked' or 'unlocked' and mode is 'edit' or 'approve'. The second line is the modification line and it contains 'status:m_user:m_email:m_timestamp', where status is 'synchronized', or 'modified'. The keys of the associative array are: lock, mode, l_user, l_email, l_timestamp, status, m_user, m_email, m_timestamp.

Definition at line 217 of file funcs.php.

References $mode, and get_state_filename().

Referenced by locked_by_somebody(), approve::non_recursive_commit(), edit::onRender(), docbook::onRender(), approve::onRender(), set_node_lock(), and set_node_status().

write_node_state ( arr_state  ) 

Definition at line 242 of file funcs.php.

References get_state_filename(), and write_file().

Referenced by set_node_lock(), and set_node_status().

set_node_status ( new_status  ) 

Set the status of the current node to the given new status.

The new status can be: synchronized or modified.

Definition at line 255 of file funcs.php.

References get_node_state(), and write_node_state().

Referenced by approve::non_recursive_commit(), approve::non_recursive_revert(), edit::on_change_title(), edit_media::on_delete(), edit_media::on_rename(), revisions::on_save(), edit_content::on_save(), and edit_media::on_upload().

set_node_lock ( lock,
mode 
)

Lock or unlock the current node.

The $lock parameter can be 'locked' or 'unlocked', and $mode can be 'edit' or 'approve'.

Definition at line 270 of file funcs.php.

References $mode, get_node_state(), locked_by_somebody(), and write_node_state().

Referenced by edit::on_set_lock(), and approve::on_set_lock().

locked_by_somebody ( arr_state = UNDEFINED  ) 

Returns true and displays a notification message, if the node is locked by another user.

Definition at line 291 of file funcs.php.

References get_node_state(), and is_locked().

Referenced by edit::on_change_id(), edit::on_change_title(), edit::on_delete(), edit_content::on_save(), edit::onRender(), docbook::onRender(), approve::onRender(), and set_node_lock().

is_locked ( arr_state  ) 

Returns true if the node is locked and the lock has not expired.

Definition at line 299 of file funcs.php.

Referenced by locked_by_somebody(), edit::onRender(), and approve::onRender().

get_date_str ( timestamp  ) 

Converts the given time stamp to a date string.

If the time is today, then give just hours and minutes, otherwise give more information.

Definition at line 320 of file funcs.php.

References T_().

Referenced by edit::onRender(), and approve::onRender().

book_fixed_to_tag ( book_id,
lng 
)

Check whether the public copy of the book is fixed to a certain tag or revision and return it.

If book is not fixed, return false.

Definition at line 372 of file funcs.php.

Referenced by changeid_movefolders(), changeid_setid(), changeid_updatecache(), create_new_node(), delete_removefolders(), approve::non_recursive_commit(), approve::recursive_commit(), transform_index(), update_navigation(), and update_subnodes_html().


Generated on Wed Jan 9 08:27:32 2008 for DokBookWiki by  doxygen 1.5.2