Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe TemplatesModelTemplate
+ Graphe d'héritage de TemplatesModelTemplate:

Fonctions membres publiques

 getFiles ()
 
 getDirectoryTree ($dir)
 
getTemplate ()
 
 checkNewName ()
 
 getFromName ()
 
 copy ()
 
 cleanup ()
 
 getForm ($data=array(), $loadData=true)
 
getSource ()
 
 save ($data)
 
 getOverridesFolder ($name, $path)
 
 getOverridesList ()
 
 createOverride ($override)
 
 createTemplateOverride ($overridePath, $htmlPath)
 
 compileLess ($input)
 
 deleteFile ($file)
 
 createFile ($name, $type, $location)
 
 uploadFile ($file, $location)
 
 createFolder ($name, $location)
 
 deleteFolder ($location)
 
 renameFile ($file, $name)
 
 getImage ()
 
 cropImage ($file, $w, $h, $x, $y)
 
 resizeImage ($file, $width, $height)
 
 getPreview ()
 
 getFont ()
 
 copyFile ($newName, $location, $file)
 
 getArchive ()
 
 extractArchive ($file)
 

Fonctions membres protégées

 getFile ($path, $name)
 
 populateState ()
 
 fixTemplateName ()
 
 loadFormData ()
 
 checkFormat ($ext)
 

Attributs protégés

 $template = null
 
 $element = null
 

Description détaillée

Template model class.

Depuis
1.6

Documentation des fonctions membres

◆ checkFormat()

checkFormat (   $ext)
protected

Check if the extension is allowed and will be shown in the template manager

Paramètres
string$extThe extension to check if it is allowed
Renvoie
boolean true if the extension is allowed false otherwise
Depuis
3.6.0

Références $params.

◆ checkNewName()

checkNewName ( )

Method to check if new template name already exists

Renvoie
boolean true if name is not used, false otherwise
Depuis
2.5

Références $db, et $query.

◆ cleanup()

cleanup ( )

Method to delete tmp folder

Renvoie
boolean true if delete successful, false otherwise
Depuis
2.5

Références $app.

◆ compileLess()

compileLess (   $input)

Compile less using the less compiler under /build.

Paramètres
string$inputThe relative location of the less file.
Renvoie
boolean true if compilation is successful, false otherwise
Depuis
3.2

Références $app, $client, $explodeArray, $input, $path, $template, et lessc\setFormatter().

◆ copy()

copy ( )

Method to check if new template name already exists

Renvoie
boolean true if name is not used, false otherwise
Depuis
2.5

Références $app, $client, $template, et jimport().

◆ copyFile()

copyFile (   $newName,
  $location,
  $file 
)

Copy a file.

Paramètres
string$newNameThe name of the copied file
string$locationThe final location where the file is to be copied
string$fileThe name and location of the file
Renvoie
boolean true if image resize successful, false otherwise.
Depuis
3.2

Références $app, $client, $explodeArray, $file, $location, $path, et $template.

◆ createFile()

createFile (   $name,
  $type,
  $location 
)

Create new file.

Paramètres
string$nameThe name of file.
string$typeThe extension of the file.
string$locationLocation for the new file.
Renvoie
boolean true if file created successfully, false otherwise
Depuis
3.2

Références $app, $check, $client, $location, $name, $path, $template, et $type.

◆ createFolder()

createFolder (   $name,
  $location 
)

Create new folder.

Paramètres
string$nameThe name of the new folder.
string$locationLocation for the new folder.
Renvoie
boolean True if override folder is created successfully, false otherwise
Depuis
3.2

Références $app, $client, $location, $name, $path, $template, et jimport().

◆ createOverride()

createOverride (   $override)

Create overrides.

Paramètres
string$overrideThe override location.
Renvoie
boolean true if override creation is successful, false otherwise
Depuis
3.2

Références $app, $client, $explodeArray, $name, $return, $template, $url, DIRECTORY_SEPARATOR, elseif, jimport(), et JPATH_ROOT.

◆ createTemplateOverride()

createTemplateOverride (   $overridePath,
  $htmlPath 
)

Create override folder & file

Paramètres
string$overridePathThe override location
string$htmlPathThe html location
Renvoie
boolean True on success. False otherwise.

Références $file, $files, $folder, $return, et null.

◆ cropImage()

cropImage (   $file,
  $w,
  $h,
  $x,
  $y 
)

Crop an image.

Paramètres
string$fileThe name and location of the file
string$wwidth.
string$hheight.
string$xx-coordinate.
string$yy-coordinate.
Renvoie
boolean true if image cropped successfully, false otherwise.
Depuis
3.2

Références $app, $client, $file, $image, $path, et $template.

◆ deleteFile()

deleteFile (   $file)

Delete a particular file.

Paramètres
string$fileThe relative location of the file.
Renvoie
boolean True if file deletion is successful, false otherwise
Depuis
3.2

Références $app, $client, $file, $path, $return, et $template.

◆ deleteFolder()

deleteFolder (   $location)

Delete a folder.

Paramètres
string$locationThe name and location of the folder.
Renvoie
boolean True if override folder is deleted successfully, false otherwise
Depuis
3.2

Références $app, $client, $location, $path, $return, $template, et jimport().

◆ extractArchive()

extractArchive (   $file)

Extract contents of an archive file.

Paramètres
string$fileThe name and location of the file
Renvoie
boolean true if image extraction is successful, false otherwise.
Depuis
3.2

Références $app, $client, $explodeArray, $file, $i, $path, et $template.

◆ fixTemplateName()

fixTemplateName ( )
protected

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

Renvoie
boolean true if successful, false otherwise
Depuis
2.5

Références $file, $files, $manifest, $template, et jimport().

◆ getArchive()

getArchive ( )

Get the compressed files.

Renvoie
array if file exists, false otherwise
Depuis
3.2

Références $app, $client, $files, $i, $path, et $template.

◆ getDirectoryTree()

getDirectoryTree (   $dir)

Get the directory tree.

Paramètres
string$dirThe path of the directory to scan
Renvoie
array
Depuis
3.2

Références $info, $key, et $value.

◆ getFile()

getFile (   $path,
  $name 
)
protected

Internal method to get file properties.

Paramètres
string$pathThe base path.
string$nameThe file name.
Renvoie
object
Depuis
1.6

Références $name, $path, et $template.

◆ getFiles()

getFiles ( )

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

Renvoie
array A nested array of relevant files.
Depuis
1.6

Références $app, $client, $lang, $path, $template, jimport(), et null.

◆ getFont()

getFont ( )

Rename a file.

Renvoie
mixed array on success, false on failure
Depuis
3.2

Références $app, $client, $explodeArray, $folder, $path, $template, et $uri.

◆ getForm()

getForm (   $data = array(),
  $loadData = true 
)

Method to get the record form.

Paramètres
array$dataData for the form.
boolean$loadDataTrue if the form is to load its own data (default case), false if not.
Renvoie
JForm A JForm object on success, false on failure
Depuis
1.6

Références $app, $db, $form, $query, et $state.

◆ getFromName()

getFromName ( )

Method to check if new template name already exists

Renvoie
string name of current template
Depuis
2.5

◆ getImage()

getImage ( )

Get an image address, height and width.

Renvoie
array an associative array containing image address, height and width.
Depuis
3.2

Références $app, $client, $folder, $image, $path, $template, et $uri.

◆ getOverridesFolder()

getOverridesFolder (   $name,
  $path 
)

Get overrides folder.

Paramètres
string$nameThe name of override.
string$pathLocation of override.
Renvoie
object containing override name and path.
Depuis
3.2

Références $folder, $name, et $path.

◆ getOverridesList()

getOverridesList ( )

Get a list of overrides.

Renvoie
array containing overrides.
Depuis
3.2

Références $client, $component, $layout, $module, $modules, $template, $view, elseif, et JPATH_ROOT.

◆ getPreview()

getPreview ( )

Template preview.

Renvoie
object object containing the id of the template.
Depuis
3.2

Références $app, $db, et $query.

◆ getSource()

& getSource ( )

Method to get a single record.

Renvoie
mixed Object on success, false on failure.
Depuis
1.6

Références $app, $client, $input, et $item.

◆ getTemplate()

& getTemplate ( )

Method to get the template information.

Renvoie
mixed Object if successful, false if not and internal error is set.
Depuis
1.6

Références $app, $db, $query, et $template.

◆ loadFormData()

loadFormData ( )
protected

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

Renvoie
mixed The data for the form.
Depuis
1.6

Références $data.

◆ populateState()

populateState ( )
protected

Method to auto-populate the model state.

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

Renvoie
void
Depuis
1.6

Références $app, $params, et jimport().

◆ renameFile()

renameFile (   $file,
  $name 
)

Rename a file.

Paramètres
string$fileThe name and location of the old file
string$nameThe new name of the file.
Renvoie
string Encoded string containing the new file location.
Depuis
3.2

Références $app, $client, $explodeArray, $file, $name, $path, $template, et $type.

◆ resizeImage()

resizeImage (   $file,
  $width,
  $height 
)

Resize an image.

Paramètres
string$fileThe name and location of the file
string$widthThe new width of the image.
string$heightThe new height of the image.
Renvoie
boolean true if image resize successful, false otherwise.
Depuis
3.2

Références $app, $client, $file, $height, $image, $path, $template, et $width.

◆ save()

save (   $data)

Method to store the source file contents.

Paramètres
array$dataThe source data to save.
Renvoie
boolean True on success, false otherwise and internal error set.
Depuis
1.6

Références $app, $client, $data, $explodeArray, $return, $template, $user, et jimport().

◆ uploadFile()

uploadFile (   $file,
  $location 
)

Upload new file.

Paramètres
string$fileThe name of the file.
string$locationLocation for the new file.
Renvoie
boolean True if file uploaded successfully, false otherwise
Depuis
3.2

Références $app, $client, $file, $location, $path, $template, $url, TemplateHelper\canUpload(), jimport(), JPATH_ADMINISTRATOR, null, et JLoader\register().

Documentation des champs

◆ $element

$element = null
protected

◆ $template

$template = null
protected

La documentation de cette classe a été générée à partir du fichier suivant :