You are here

function _filebrowser_get_node_root in Filebrowser 8

Same name and namespace in other branches
  1. 7.4 filebrowser.common.inc \_filebrowser_get_node_root()
  2. 7.2 filebrowser.common.inc \_filebrowser_get_node_root()
  3. 7.3 filebrowser.common.inc \_filebrowser_get_node_root()

Helper function to get node folder with correct token replacements. Never use $node->folder_path directly !!!

Parameters

$node:

Return value

folder path

3 calls to _filebrowser_get_node_root()
filebrowser_form_delete_confirm_submit in ./filebrowser.module
File delete confirmation form submit
filebrowser_page_download in ./filebrowser.pages.inc
Callback for filebrowser_download/%node menu.
_filebrowser_load_files in ./filebrowser.common.inc
Load data from current path.

File

./filebrowser.common.inc, line 69
Misc filebrowser common functions.

Code

function _filebrowser_get_node_root(&$node) {
  $result = $node->folder_path;

  // token_replace is in D7 core *** if (module_exists("token")) {
  $result = token_replace($result, array(
    'type' => 'global',
    'object' => NULL,
    'leading' => '[',
    $trailing = ']',
  ));
  return $result;
}