init_files

4.1.0

Tag {init_files} displayes files from one folder.

Parameters

  • parent - folder ID where to get the files. If parent is not defined then folder "public/" ID is used.
  • parent_dir - a relative path to the files, eg "public/documents" overrides "parent. 4.5.0
  • name - variable name where the returned data is saved. Default value is "files".
  • buttons - defines which action buttons are displayed to the site editor. Values can be "new,edit,hide,move,delete".
  • start - the starting row number to return.
  • limit - the number of rows to return. You must use this parameter always with "start" parameter.
  • order - defines how files are sorted.
  • profile - defines the profile(s) of the files. Value must exactly match the profile name in the site's administration area. Multiple profile name values must be separated by comma.
  • icons - relative path to the icons folder, eg "extensions/saurus4/images/file_icons/"
  • where additional filtering criteria using WHERE SQL syntax.
  • select - additional table fields to return using SELECT SQL syntax.

Attributes

  • id - ID number of the file
  • parent_id - ID number of parent object.
  • href - link to the file
  • title - title of the file
  • buttons - action-buttons, available only for editors.
  • parent - parent folder ID
  • folder_fullpath - absolute path to the parent folder
  • fullpath - absolute path to the file, including filename
  • filename - filename
  • mimetype - MIME type of the file, eg "image/gif"
  • profile_id - profile ID of the file
  • extension - extension of the filename, eg "gif"
  • icon - relative path to file type icon
  • class - class name of the object.
  • date - date of the file
  • fdate - date of the file in database default format, eg yyyy-mm-dd.
  • datetime - date and time of the file, format dd.mm.yyyy hh:mm. 4.4.1
  • fdatetime - date and time of the file in database format, eg yyyy-mm-dd hh:mm:ss. 4.4.1
  • created_user_id - user ID who initially created the object.
  • created_user_name - user full name who initially created the object.
  • changed_user_id - user ID who made the last object saving.
  • changed_user_name - user full name who made the last object saving.
  • created_time - creating time of the object in format dd.mm.yyyy hh:ii.
  • fcreated_time - creating time of the object in database default format, eg yyyy-mm-dd hh:ii.
  • changed_time - last saving time of the object in format dd.mm.yyyy hh:ii.
  • fchanged_time - last saving time of the object in database default format, eg yyyy-mm-dd hh:ii.
  • comment_count - the number of comments.
  • last_commented_time - the last comment time in format dd.mm.yyyy hh:ii.

General tags

  • <name>_newbutton - prints "New" action-button for creating a new object.
  • <name>_count - the number of returned objects.  If parameter "limit" is set then count equals to "limit" value.
  • <name>_counttotal - the total number of objects found, not affected by "limit" parameter.

Example:

{init_files parent=$folder_id icons="extensions/saurus4/images/file_icons/"}
{foreach from=$files item="file"}
 {if $file->icon}<a href="{$file->href}" target="_blank" class="DocumentIcon"><img src="{$file->icon}" alt=""></a>{/if}
 
 {$file->buttons}<a href="{$file->href}" target="_blank">{$file->title}</a>
 {$file->date}
 {$file->size}
 {$file->extension}
{foreachelse}
 {$files_newbutton}
{/foreach}