Class TemplatesModelTemplate

Description

Template model class.

  • since: 1.6

Located in /administrator/components/com_templates/models/template.php (line 19)

JObject
   |
   --JModelLegacy
      |
      --JModelForm
         |
         --TemplatesModelTemplate
Variable Summary
 mixed $element
 mixed $template
Method Summary
 boolean checkNewName ()
 boolean cleanup ()
 boolean compileLess (string $input)
 boolean copy ()
 boolean copyFile (string $newName, string $location, string $file)
 boolean createFile (string $name, string $type, string $location)
 boolean createFolder (string $name, string $location)
 boolean createOverride (string $override)
 boolean cropImage (string $file, string $w, string $h, string $x, string $y)
 boolean deleteFile (string $file)
 boolean deleteFolder (string $location)
 boolean extractArchive (string $file)
 boolean fixTemplateName ()
 array getArchive ()
 array getDirectoryTree (string $dir)
 object getFile (string $path, string $name)
 array getFiles ()
 mixed getFont ()
 JForm getForm ([array $data = array()], [boolean $loadData = true])
 string getFromName ()
 object object getHathor ()
 array getImage ()
 object containing getOverridesFolder (string $name, string $path)
 array getOverridesList ()
 object object getPreview ()
 mixed &getSource ()
 mixed &getTemplate ()
 mixed loadFormData ()
 void populateState ()
 string renameFile (string $file, string $name)
 boolean resizeImage (string $file, string $width, string $height)
 boolean save (array $data)
 boolean uploadFile (string $file, string $location)
Variables
mixed $element = null (line 23)
  • access: protected
mixed $template = null (line 21)
  • access: protected

Inherited Variables

Inherited from JModelForm

JModelForm::$_forms

Inherited from JModelLegacy

JModelLegacy::$event_clean_cache
JModelLegacy::$name
JModelLegacy::$option
JModelLegacy::$state
JModelLegacy::$_db
JModelLegacy::$__state_set

Inherited from JObject

JObject::$_errors
Methods
checkNewName (line 219)

Method to check if new template name already exists

  • return: true if name is not used, false otherwise
  • since: 2.5
  • access: public
boolean checkNewName ()
cleanup (line 296)

Method to delete tmp folder

  • return: true if delete successful, false otherwise
  • since: 2.5
  • access: public
boolean cleanup ()
compileLess (line 682)

Compile less using the less compiler under /build.

  • return: true if compilation is successful, false otherwise
  • since: 3.2
  • access: public
boolean compileLess (string $input)
  • string $input: The relative location of the less file.
copy (line 250)

Method to check if new template name already exists

  • return: true if name is not used, false otherwise
  • since: 2.5
  • access: public
boolean copy ()
copyFile (line 1200)

Copy a file.

  • return: true if image resize successful, false otherwise.
  • since: 3.2
  • access: public
boolean copyFile (string $newName, string $location, string $file)
  • string $newName: The name of the copied file
  • string $location: The final location where the file is to be copied
  • string $file: The name and location of the file
createFile (line 758)

Create new file.

  • return: true if file created successfully, false otherwise
  • since: 3.2
  • access: public
boolean createFile (string $name, string $type, string $location)
  • string $name: The name of file.
  • string $type: The extension of the file.
  • string $location: Location for the new file.
createFolder (line 844)

Create new folder.

  • return: True if override folder is created successfully, false otherwise
  • since: 3.2
  • access: public
boolean createFolder (string $name, string $location)
  • string $name: The name of the new folder.
  • string $location: Location for the new folder.
createOverride (line 602)

Create overrides.

  • return: true if override creation is successful, false otherwise
  • since: 3.2
  • access: public
boolean createOverride (string $override)
  • string $override: The override location.
cropImage (line 1012)

Crop an image.

  • return: true if image cropped successfully, false otherwise.
  • since: 3.2
  • access: public
boolean cropImage (string $file, string $w, string $h, string $x, string $y)
  • string $file: The name and location of the file
  • string $w: width.
  • string $h: height.
  • string $x: x-coordinate.
  • string $y: y-coordinate.
deleteFile (line 725)

Delete a particular file.

  • return: True if file deletion is successful, false otherwise
  • since: 3.2
  • access: public
boolean deleteFile (string $file)
  • string $file: The relative location of the file.
deleteFolder (line 881)

Delete a folder.

  • return: True if override folder is deleted successfully, false otherwise
  • since: 3.2
  • access: public
boolean deleteFolder (string $location)
  • string $location: The name and location of the folder.
extractArchive (line 1288)

Extract contents of a archive file.

  • return: true if image extraction is successful, false otherwise.
  • since: 3.2
  • access: public
boolean extractArchive (string $file)
  • string $file: The name and location of the file
fixTemplateName (line 314)

Method to rename the template in the XML files and rename the language files

  • return: true if successful, false otherwise
  • since: 2.5
  • access: protected
boolean fixTemplateName ()
getArchive (line 1239)

Get the compressed files.

  • return: if file exists, false otherwise
  • since: 3.2
  • access: public
array getArchive ()
getDirectoryTree (line 101)

Get the directory tree.

  • since: 3.2
  • access: public
array getDirectoryTree (string $dir)
  • string $dir: The path of the directory to scan
getFile (line 35)

Internal method to get file properties.

  • since: 1.6
  • access: protected
object getFile (string $path, string $name)
  • string $path: The base path.
  • string $name: The file name.
getFiles (line 55)

Method to get a list of all the files to edit in a template.

  • return: A nested array of relevant files.
  • since: 1.6
  • access: public
array getFiles ()
getFont (line 1117)

Rename a file.

  • return: array on success, false on failure
  • since: 3.2
  • access: public
mixed getFont ()
getForm (line 358)

Method to get the record form.

  • return: A JForm object on success, false on failure
  • since: 1.6
  • access: public
JForm getForm ([array $data = array()], [boolean $loadData = true])
  • array $data: Data for the form.
  • boolean $loadData: True if the form is to load its own data (default case), false if not.

Redefinition of:
JModelForm::getForm()
Abstract method for getting the form from the model.
getFromName (line 238)

Method to check if new template name already exists

  • return: name of current template
  • since: 2.5
  • access: public
string getFromName ()
getHathor (line 1166)

Check the admin template.

  • return: containing the id of the template.
  • since: 3.2
  • access: public
object object getHathor ()
getImage (line 959)

Get an image address, height and width.

  • return: an associative array containing image address, height and width.
  • since: 3.2
  • access: public
array getImage ()
getOverridesFolder (line 531)

Get overrides folder.

  • return: override name and path.
  • since: 3.2
  • access: public
object containing getOverridesFolder (string $name, string $path)
  • string $name: The name of override.
  • string $path: Location of override.
getOverridesList (line 547)

Get a list of overrides.

  • return: containing overrides.
  • since: 3.2
  • access: public
array getOverridesList ()
getPreview (line 1079)

Template preview.

  • return: containing the id of the template.
  • since: 3.2
  • access: public
object object getPreview ()
getSource (line 415)

Method to get a single record.

  • return: Object on success, false on failure.
  • since: 1.6
  • access: public
mixed &getSource ()
getTemplate (line 170)

Method to get the template information.

  • return: Object if successful, false if not and internal error is set.
  • since: 1.6
  • access: public
mixed &getTemplate ()
loadFormData (line 399)

Method to get the data that should be injected in the form.

  • return: The data for the form.
  • since: 1.6
  • access: protected
mixed loadFormData ()

Redefinition of:
JModelForm::loadFormData()
Method to get the data that should be injected in the form.
populateState (line 149)

Method to auto-populate the model state.

Note. Calling getState in this method will result in recursion.

  • since: 1.6
  • access: protected
void populateState ()

Redefinition of:
JModelLegacy::populateState()
Method to auto-populate the model state.
renameFile (line 921)

Rename a file.

  • return: Encoded string containing the new file location.
  • since: 3.2
  • access: public
string renameFile (string $file, string $name)
  • string $file: The name and location of the old file
  • string $name: The new name of the file.
resizeImage (line 1047)

Resize an image.

  • return: true if image resize successful, false otherwise.
  • since: 3.2
  • access: public
boolean resizeImage (string $file, string $width, string $height)
  • string $file: The name and location of the file
  • string $width: The new width of the image.
  • string $height: The new height of the image.
save (line 456)

Method to store the source file contents.

  • return: True on success, false otherwise and internal error set.
  • since: 1.6
  • access: public
boolean save (array $data)
  • array $data: The source data to save.
uploadFile (line 794)

Upload new file.

  • return: True if file uploaded successfully, false otherwise
  • since: 3.2
  • access: public
boolean uploadFile (string $file, string $location)
  • string $file: The name of the file.
  • string $location: Location for the new file.

Inherited Methods

Inherited From JModelForm

 JModelForm::checkin()
 JModelForm::checkout()
 JModelForm::getForm()
 JModelForm::loadForm()
 JModelForm::loadFormData()
 JModelForm::preprocessData()
 JModelForm::preprocessForm()
 JModelForm::validate()

Inherited From JModelLegacy

 JModelLegacy::__construct()
 JModelLegacy::addIncludePath()
 JModelLegacy::addTablePath()
 JModelLegacy::cleanCache()
 JModelLegacy::getDbo()
 JModelLegacy::getInstance()
 JModelLegacy::getName()
 JModelLegacy::getState()
 JModelLegacy::getTable()
 JModelLegacy::loadHistory()
 JModelLegacy::populateState()
 JModelLegacy::setDbo()
 JModelLegacy::setState()
 JModelLegacy::_createFileName()
 JModelLegacy::_createTable()
 JModelLegacy::_getList()
 JModelLegacy::_getListCount()

Inherited From JObject

 JObject::__construct()
 JObject::def()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::__toString()

Documentation generated on Tue, 19 Nov 2013 15:15:27 +0100 by phpDocumentor 1.4.3