Template.php

Classes

Template This class provides the template system for owncloud. You can use it to load specific templates, add data and generate the html code

Functions

image_path()

image_path(string  $app, string  $image) : string

Make OC_Helper::imagePath available as a simple function

Parameters

string $app
string $image

Returns

string —

to the image

mimetype_icon()

mimetype_icon(string  $mimetype) : string

Make OC_Helper::mimetypeIcon available as a simple function

Parameters

string $mimetype

Returns

string —

to the image of this file type.

preview_icon()

preview_icon(string  $path) : string

Make preview_icon available as a simple function

Parameters

string $path

path to file

Returns

string —

to the preview of the image

publicPreview_icon()

publicPreview_icon(string  $path, string  $token) : string

Make publicpreview_icon available as a simple function Returns the path to the preview of the image.

Parameters

string $path

of file

string $token

Returns

string —

link to the preview

human_file_size()

human_file_size(integer  $bytes) : string

Make OC_Helper::humanFileSize available as a simple function Example: 2048 to 2 kB.

Parameters

integer $bytes

in bytes

Returns

string —

size as string

relative_modified_date()

relative_modified_date(integer  $timestamp, boolean  $dateOnly = false) : \OC_L10N_String

Return the relative date in relation to today. Returns something like "last hour" or "two month ago"

Parameters

integer $timestamp

unix timestamp

boolean $dateOnly

Returns

\OC_L10N_String —

human readable interpretation of the timestamp

simple_file_size()

simple_file_size(integer  $bytes) : string

Return a human readable outout for a file size.

Parameters

integer $bytes

size of a file in byte

Returns

string —

human readable interpretation of a file size

html_select_options()

html_select_options(array  $options, mixed  $selected, array  $params = array()) : string

Generate html code for an options block.

Parameters

array $options

the options

mixed $selected

which one is selected?

array $params

the parameters

Returns

string —

html options