You are here

function _filetree_tips in File Tree 7.2

Same name and namespace in other branches
  1. 7 filetree.module \_filetree_tips()

Implements hook_filter_FILTER_tips().

1 string reference to '_filetree_tips'
filetree_filter_info in ./filetree.module
Implements hook_filter_info().

File

./filetree.module, line 103

Code

function _filetree_tips($filter, $format, $long = FALSE) {
  $output = t('You may use [filetree dir="some-directory"] to display a list of files inline.');
  if ($long) {
    $output = '<p>' . $output . '</p>';
    $output .= '<p>' . t('Additional options include "multi", "controls", "absolute", "exclude", "dirname", "dirtitle", "filename", "filetitle", and "animation". For example:') . '</p>';
    $output .= '<blockquote>[filetree dir="some-directory" multi="false" controls="false" absolute="false" exclude="CVS; directory1; directory2" dirname="%basename" dirtitle="Click to toggle this folder." filename="%basename" filetitle="Click to download this %extension file." animation="false"]</blockquote>';
    $output .= '<p>' . t('Available tokens for use within the "dirname", "dirtitle", "filename", and "filetitle" options include:') . '</p>';
    $output .= theme('item_list', array(
      'items' => array(
        '%filename: ' . t('Filename, with extension.'),
        '%basename: ' . t('File name, without extension.'),
        '%extension: ' . t('File extension.'),
        '%size: ' . t('Size of the file in human-readable format.'),
        '%created: ' . t('Date the file was created, using the <a href="!url">File Tree format</a>.', array(
          '!url' => url('admin/config/regional/date-time'),
        )),
        '%modified: ' . t('Date the file was modified, using the <a href="!url">File Tree format</a>.', array(
          '!url' => url('admin/config/regional/date-time'),
        )),
      ),
    ));
    $output .= '<p>' . t('You may format the way each file is listed via the "fileformat" option. The tokens above are available, in addition to a "%link" option, which renders the "filename" token. For example:') . '</p>';
    $output .= '<blockquote>[filetree dir="some-directory" fileformat="%link - %size"]</blockquote>';
    $output .= '<p>' . t('You can also read a <a href="http://drupal.org/project/filetree">detailed explanation of these options</a>.') . '</p>';
  }
  return $output;
}