Dotclear 2.24
Loading...
Searching...
No Matches
dcThemeEditor Class Reference

Public Member Functions

 __construct ()
 
 filesList (string $type, string $item='%1$s', bool $split=true)
 
 getFileContent (string $type, string $f)
 
 writeFile (string $type, string $f, string $content)
 
 deletableFile (string $type, string $f)
 
 deleteFile ($type, $f)
 

Data Fields

 $tpl = []
 
 $css = []
 
 $js = []
 
 $po = []
 
 $php = []
 

Protected Member Functions

 getDestinationFile (string $type, string $f)
 
 getFilesFromType (string $type)
 
 updateFileInList (string $type, string $f, string $file)
 
 findTemplates ()
 
 findStyles ()
 
 findScripts ()
 
 findLocales ()
 
 findCodes ()
 
 sortFilesHelper (string $a, string $b)
 
 getFilesInDir (string $dir, ?string $ext=null, string $prefix='', ?string $model=null)
 

Protected Attributes

 $user_theme
 
 $parent_theme
 
 $tplset_theme
 
 $parent_name
 
 $tplset_name
 
 $tpl_model = []
 

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ filesList()

filesList ( string  $type,
string  $item = '%1$s',
bool  $split = true 
)

Display a file list

Parameters
string$typeThe type of file
string$itemThe item pattern
bool$splitSplit from source?
Returns
string

References html\escapeHTML(), and getFilesFromType().

◆ getFileContent()

getFileContent ( string  $type,
string  $f 
)

Gets the file content.

Parameters
string$typeThe type
string$fThe file ID
Exceptions
Exception
Returns
array The file content.

References getDestinationFile(), and getFilesFromType().

◆ writeFile()

writeFile ( string  $type,
string  $f,
string  $content 
)

Writes a file.

Parameters
string$typeThe type
string$fThe file ID
string$contentThe content
Exceptions
Exception

References getDestinationFile(), getFilesFromType(), files\makeDir(), and updateFileInList().

◆ deletableFile()

deletableFile ( string  $type,
string  $f 
)

Check if a file is deletable

Parameters
string$typeThe type
string$fThe file ID
Returns
bool

References getDestinationFile(), and getFilesFromType().

◆ deleteFile()

deleteFile (   $type,
  $f 
)

Delete a file

Parameters
string$typeThe type
string$fThe file ID
Exceptions
Exception

References findTemplates(), getDestinationFile(), and getFilesFromType().

◆ getDestinationFile()

getDestinationFile ( string  $type,
string  $f 
)
protected

Gets the destination file.

Parameters
string$typeThe type
string$fThe file ID
Returns
bool|string The destination file.

Referenced by deletableFile(), deleteFile(), getFileContent(), and writeFile().

◆ getFilesFromType()

getFilesFromType ( string  $type)
protected

Gets the files list from type.

Parameters
string$typeThe type
Returns
array The list.

References $css, $js, $php, $po, and $tpl.

Referenced by deletableFile(), deleteFile(), filesList(), getFileContent(), and writeFile().

◆ updateFileInList()

updateFileInList ( string  $type,
string  $f,
string  $file 
)
protected

Update a file in a list

Parameters
string$typeThe type
string$fThe file ID
string$fileThe file

References $css, $js, $php, $po, and $tpl.

Referenced by writeFile().

◆ findTemplates()

findTemplates ( )
protected

Get template files of theme.

References $tpl, dcCore\app(), and getFilesInDir().

Referenced by __construct(), and deleteFile().

◆ findStyles()

findStyles ( )
protected

Get CSS files of theme.

References getFilesInDir().

Referenced by __construct().

◆ findScripts()

findScripts ( )
protected

Get Javascript files of theme.

References getFilesInDir().

Referenced by __construct().

◆ findLocales()

findLocales ( )
protected

Get translations files of theme.

References getFilesInDir(), and l10n\getISOcodes().

Referenced by __construct().

◆ findCodes()

findCodes ( )
protected

Get PHP files of theme.

References getFilesInDir().

Referenced by __construct().

◆ sortFilesHelper()

sortFilesHelper ( string  $a,
string  $b 
)
protected

Stack files sorting helper

Sort by file extension first, then by file name

Parameters
string$a1st file
string$b2nd file
Returns
int

References files\getExtension().

◆ getFilesInDir()

getFilesInDir ( string  $dir,
?string  $ext = null,
string  $prefix = '',
?string  $model = null 
)
protected

Gets the files in dir.

Parameters
string$dirThe dir
null | string$extThe search extension
string$prefixThe key prefix
null | string$modelThe model
Returns
array The files in dir.

References path\real().

Referenced by findCodes(), findLocales(), findScripts(), findStyles(), and findTemplates().

Field Documentation

◆ $user_theme

$user_theme
protected

◆ $parent_theme

$parent_theme
protected

Referenced by __construct().

◆ $tplset_theme

$tplset_theme
protected

◆ $parent_name

$parent_name
protected

◆ $tplset_name

$tplset_name
protected

◆ $tpl_model

$tpl_model = []
protected

◆ $tpl

$tpl = []

◆ $css

$css = []

◆ $js

$js = []

◆ $po

$po = []

◆ $php

$php = []

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