Static Public Member Functions | Public Attributes | Static Public Attributes

Media Class Reference

List of all members.

Static Public Member Functions

static dir ($path= '')
static get ($path, $qualities=null)
static prepare ($path)
static put ($filedata, $path=null)
static delete ($path)
static copy ($pathfrom, $pathto)
static move ($pathfrom, $pathto)
static highlights ($path=null)
static permissions ($path)
static get_silo (&$silo, $parse_path=false)
static init_silos ()

Public Attributes

const THUMBNAIL_WIDTH = 200
const THUMBNAIL_HEIGHT = 100

Static Public Attributes

static $silos = null

Detailed Description

Media access

Version:
$Id$ 2008
Todo:
Handle all error conditions using exceptions

Definition at line 17 of file media.php.


Member Function Documentation

static Media::copy ( pathfrom,
pathto 
) [static]

Copy the asset using the specified from and to paths

Parameters:
string $pathfrom The virtual path source
string $pathto The virtual path destination
Returns:
boolean true on success

Definition at line 121 of file media.php.

Referenced by move().

static Media::delete ( path  )  [static]

Delete the asset at the specified virtual path

Parameters:
string $path The virtual path of the asset to delete
Returns:
boolean true on success

Definition at line 103 of file media.php.

Referenced by move().

static Media::dir ( path = ''  )  [static]

Retrieve an array of media assets stored at a virtual path

Parameters:
string $path The virtual path of the directory to retrieve
Returns:
array A list of files and directories in that path

Definition at line 29 of file media.php.

Referenced by AdminPostsHandler::ajax_media(), and FormControlSilos::get().

static Media::get ( path,
qualities = null 
) [static]

Get the MediaAsset stored at a virtual path

Parameters:
string $path The virtual path of the file to retrieve
array $qualities Qualities of the image to return (such as 'thumbnail' or 'size')
Returns:
MediaAsset The requested asset

Definition at line 54 of file media.php.

Referenced by MediaAsset::_get(), and copy().

static Media::get_silo ( &$  silo,
parse_path = false 
) [static]

Return the instance of a silo

Parameters:
mixed $silo A silo instance or the name of a silo
boolean $parse_path If true, parse the siloname from the path and return the remainder path by reference
Returns:
MediaSilo The requested silo

Definition at line 190 of file media.php.

Referenced by AdminPostsHandler::ajax_media(), AdminPostsHandler::ajax_media_panel(), AdminPostsHandler::ajax_media_upload(), delete(), dir(), get(), highlights(), permissions(), prepare(), and put().

static Media::highlights ( path = null  )  [static]

Return an array of highlighted (featured) assets from all silos

Parameters:
mixed $path The name of a silo or a silo instance. If empty, all silos are returned.
Returns:
array An array of MediaAsset highlight assets

Definition at line 155 of file media.php.

static Media::init_silos (  )  [static]

Initialize the internal list of silo instances

Definition at line 213 of file media.php.

Referenced by dir(), get_silo(), and highlights().

static Media::move ( pathfrom,
pathto 
) [static]

Move the asset using the specified from and to paths A shortcut for Media::copy() then Media::delete()

Parameters:
string $pathfrom The virtual path source
string $pathto The virtual path destination
Returns:
boolean true on success

Definition at line 139 of file media.php.

static Media::permissions ( path  )  [static]

Return the permissions available to the current user on the specified path

Parameters:
mixed $path The name of a silo or a silo instance.
Returns:
array An array of permission constants (read, write, etc.)

Definition at line 177 of file media.php.

static Media::prepare ( path  )  [static]

Fetch an empty MediaAsset with the available metadata keys pre-allocated $asset = Media::prepare('silotype/foo/bar'); foreach($asset->get_info() as $key => $value) echo "$key : $value";

Parameters:
string $path The virtual path at which the asset will be stored
Returns:
MediaAsset An empty, intialized asset instance

Definition at line 70 of file media.php.

static Media::put ( filedata,
path = null 
) [static]

Store the asset at the specified virtual path

Parameters:
MediaAsset $filedata The asset to store
string $path The virtual path where the asset will be stored
Returns:
boolean true on success

Definition at line 83 of file media.php.

Referenced by copy().


The documentation for this class was generated from the following file: