[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_templates/src/Model/ -> TemplateModel.php (summary)

(no description)

Copyright: (C) 2008 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 2070 lines (70 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

TemplateModel:: (47 methods):
  getFile()
  storeFileInfo()
  getTemplateList()
  getUpdatedList()
  getCoreList()
  prepareCoreFiles()
  publish()
  getFiles()
  getDirectoryTree()
  getCoreFile()
  getSafeName()
  validateDate()
  populateState()
  getTemplate()
  checkNewName()
  getFromName()
  copy()
  cleanup()
  fixTemplateName()
  getForm()
  loadFormData()
  getSource()
  save()
  getOverridesFolder()
  getOverridesList()
  createOverride()
  createTemplateOverride()
  deleteFile()
  createFile()
  uploadFile()
  createFolder()
  deleteFolder()
  renameFile()
  getImage()
  cropImage()
  resizeImage()
  getPreview()
  getFont()
  copyFile()
  getArchive()
  extractArchive()
  checkFormat()
  getMediaFiles()
  getBasePath()
  child()
  getAllTemplateStyles()
  copyStyles()


Class: TemplateModel  - X-Ref

Template model class.

getFile($path, $name)   X-Ref
Internal method to get file properties.

param: string  $path  The base path.
param: string  $name  The file name.
return: object

storeFileInfo($path, $name, $template)   X-Ref
Method to store file information.

param: string    $path      The base path.
param: string    $name      The file name.
param: stdClass  $template  The std class object of template.
return: object  stdClass object.

getTemplateList()   X-Ref
Method to get all template list.

return: object  stdClass object

getUpdatedList($state = false, $all = false, $cleanup = false)   X-Ref
Method to get all updated file list.

param: boolean  $state    The optional parameter if you want unchecked list.
param: boolean  $all      The optional parameter if you want all list.
param: boolean  $cleanup  The optional parameter if you want to clean record which is no more required.
return: object  stdClass object

getCoreList()   X-Ref
Method to get a list of all the core files of override files.

return: array  An array of all core files.

prepareCoreFiles($dir, $element, $template)   X-Ref
No description

publish($ids, $value, $exid)   X-Ref
Method to update status of list.

param: array    $ids    The base path.
param: array    $value  The file name.
param: integer  $exid   The template extension id.
return: integer  Number of files changed.

getFiles()   X-Ref
Method to get a list of all the files to edit in a template.

return: array  A nested array of relevant files.

getDirectoryTree($dir)   X-Ref
Get the directory tree.

param: string  $dir  The path of the directory to scan
return: array

getCoreFile($file, $client_id)   X-Ref
Method to get the core file of override file

param: string   $file       Override file
param: integer  $client_id  Client Id
return: string  $corefile The full path and file name for the target file, or boolean false if the file is not found in any of the paths.

getSafeName($name)   X-Ref
Creates a safe file name for the given name.

param: string  $name  The filename
return: string $fileName  The filtered name without Date

validateDate($date)   X-Ref
Validate Date in file name.

param: string  $date  Date to validate.
return: boolean Return true if date is valid and false if not.

populateState()   X-Ref
Method to auto-populate the model state.

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

return: void

getTemplate()   X-Ref
Method to get the template information.

return: mixed  Object if successful, false if not and internal error is set.

checkNewName()   X-Ref
Method to check if new template name already exists

return: boolean   true if name is not used, false otherwise

getFromName()   X-Ref
Method to check if new template name already exists

return: string     name of current template

copy()   X-Ref
Method to check if new template name already exists

return: boolean   true if name is not used, false otherwise

cleanup()   X-Ref
Method to delete tmp folder

return: boolean   true if delete successful, false otherwise

fixTemplateName()   X-Ref
Method to rename the template in the XML files and rename the language files

return: boolean  true if successful, false otherwise

getForm($data = array()   X-Ref
Method to get the record form.

param: array    $data      Data for the form.
param: boolean  $loadData  True if the form is to load its own data (default case), false if not.
return: Form|boolean    A Form object on success, false on failure

loadFormData()   X-Ref
Method to get the data that should be injected in the form.

return: mixed  The data for the form.

getSource()   X-Ref
Method to get a single record.

return: mixed  Object on success, false on failure.

save($data)   X-Ref
Method to store the source file contents.

param: array  $data  The source data to save.
return: boolean  True on success, false otherwise and internal error set.

getOverridesFolder($name, $path)   X-Ref
Get overrides folder.

param: string  $name  The name of override.
param: string  $path  Location of override.
return: object  containing override name and path.

getOverridesList()   X-Ref
Get a list of overrides.

return: array containing overrides.

createOverride($override)   X-Ref
Create overrides.

param: string  $override  The override location.
return: boolean  true if override creation is successful, false otherwise

createTemplateOverride($overridePath, $htmlPath)   X-Ref
Create override folder & file

param: string  $overridePath  The override location
param: string  $htmlPath      The html location
return: boolean                True on success. False otherwise.

deleteFile($file)   X-Ref
Delete a particular file.

param: string  $file  The relative location of the file.
return: boolean  True if file deletion is successful, false otherwise

createFile($name, $type, $location)   X-Ref
Create new file.

param: string  $name      The name of file.
param: string  $type      The extension of the file.
param: string  $location  Location for the new file.
return: boolean  true if file created successfully, false otherwise

uploadFile($file, $location)   X-Ref
Upload new file.

param: array   $file      The uploaded file array.
param: string  $location  Location for the new file.
return: boolean  True if file uploaded successfully, false otherwise

createFolder($name, $location)   X-Ref
Create new folder.

param: string  $name      The name of the new folder.
param: string  $location  Location for the new folder.
return: boolean  True if override folder is created successfully, false otherwise

deleteFolder($location)   X-Ref
Delete a folder.

param: string  $location  The name and location of the folder.
return: boolean  True if override folder is deleted successfully, false otherwise

renameFile($file, $name)   X-Ref
Rename a file.

param: string  $file  The name and location of the old file
param: string  $name  The new name of the file.
return: string  Encoded string containing the new file location.

getImage()   X-Ref
Get an image address, height and width.

return: array an associative array containing image address, height and width.

cropImage($file, $w, $h, $x, $y)   X-Ref
Crop an image.

param: string  $file  The name and location of the file
param: string  $w     width.
param: string  $h     height.
param: string  $x     x-coordinate.
param: string  $y     y-coordinate.
return: boolean     true if image cropped successfully, false otherwise.

resizeImage($file, $width, $height)   X-Ref
Resize an image.

param: string  $file    The name and location of the file
param: string  $width   The new width of the image.
param: string  $height  The new height of the image.
return: boolean  true if image resize successful, false otherwise.

getPreview()   X-Ref
Template preview.

return: object  object containing the id of the template.

getFont()   X-Ref
Rename a file.

return: mixed  array on success, false on failure

copyFile($newName, $location, $file)   X-Ref
Copy a file.

param: string  $newName   The name of the copied file
param: string  $location  The final location where the file is to be copied
param: string  $file      The name and location of the file
return: boolean  true if image resize successful, false otherwise.

getArchive()   X-Ref
Get the compressed files.

return: array if file exists, false otherwise

extractArchive($file)   X-Ref
Extract contents of an archive file.

param: string  $file  The name and location of the file
return: boolean  true if image extraction is successful, false otherwise.

checkFormat($ext)   X-Ref
Check if the extension is allowed and will be shown in the template manager

param: string  $ext  The extension to check if it is allowed
return: boolean  true if the extension is allowed false otherwise

getMediaFiles()   X-Ref
Method to get a list of all the files to edit in a template's media folder.

return: array  A nested array of relevant files.

getBasePath()   X-Ref
Method to resolve the base folder.

return: string  The absolute path for the base.

child()   X-Ref
Method to create the templateDetails.xml for the child template

return: boolean   true if name is not used, false otherwise

getAllTemplateStyles()   X-Ref
Method to get the parent template existing styles

return: array   array of id,titles of the styles

copyStyles()   X-Ref
Method to copy selected styles to the child template

return: boolean   true if name is not used, false otherwise



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer