A class to represent a stylesheet.
This class is capable of managing a single stylesheet, and has static methods for loading stylesheets from the database. Loaded stylesheets are cached in internal memory to ensure that the same stylesheet is not loaded twice for a request.
Stylesheets are (optionally) attached to designs (CmsLayoutCollection) see the {cms_stylesheet} plugin for more information.
package |
CMS |
---|---|
license |
GPL |
since | 2.0 |
author |
Robert Campbell calguy1000@gmail.com |
see |
get_id() : integer
integer
get_name() : string
string
set_name(string $str)
string
$strget_content() : string
string
set_content(string $str)
string
$strget_description() : string
string
set_description(string $str)
string
$strget_media_types() : array
array
has_media_type(string $str) : boolean
string
$strThe media type name
boolean
add_media_type(string $str) : boolean
string
$strThe media type name
boolean
set_media_types(mixed $arr)
mixed
$arrEither a string, or an array of strings.
get_media_query() : string
string
set_media_query(string $str)
string
$strget_created() : integer
integer
get_modified() : integer
integer
get_designs() : array
array
Array of integer design ids
set_designs(array $x)
array
$xArray of integer design ids
add_design(mixed $a)
mixed
$aAn Instance of a CmsLayoutCollection object, or an integer design id, or a string design name
remove_design(mixed $a)
mixed
$aAn Instance of a CmsLayoutCollection object, or an integer design id, or a string design name
validate()
save()
This method sends events before and after saving. EditStylesheetPre is sent before an existing stylesheet is saved to the database EditStylesheetPost is sent after an existing stylesheet is saved to the database AddStylesheetPre is sent before a new stylesheet is saved to the database AddStylesheetPost is sent after a new stylesheet is saved to the database
delete()
This method triggers the DeleteStylesheetPre and DeleteStylesheetPost events
locked() : boolean
boolean
lock_expired() : boolean
If the object is not locked false is returned
boolean
load(mixed $a) : \CmsLayoutStylesheet
mixed
$aEither an integer stylesheet id, or a string stylesheet name.
load_bulk(array $ids, boolean $deep = true) : array
This method does not throw exceptions if one requested id, or name does not exist.
array
$idsArray of integer stylesheet ids or an array of string stylesheet names.
boolean
$deepwether or not to load associated data
array
Array of CmsLayoutStylesheet objects
get_all(boolean $as_list = FALSE) : mixed
boolean
$as_lista flag indicating the output format
mixed
If $as_list is true then the output will be an associated array of stylesheet id and stylesheet name suitable for use in an html select element otherwise, an array of CmsLayoutStylesheet objects is returned
is_loaded(mixed $id) : boolean
mixed
$idEither an integer stylesheet id, or a string stylesheet name
boolean
generate_unique_name(string $prototype, string $prefix = null)
string
$prototypeA prototype template name
string
$prefixAn optional name prefix.
get_content_filename() : string
string
has_content_file() : boolean
boolean