General helper class for survey themes
package | Default |
---|
getFileCategories(string $themeName,mixed $sid = null): array<mixed,\LimeSurvey\Datavalueobjects\ThemeFileCategory>
Each category is related to a directory which holds files for the theme. This files are usually listed to be selected as values for options.
string
mixed
array<mixed,\LimeSurvey\Datavalueobjects\ThemeFileCategory>
getRealThemeFilePath(string $path,string $themeName,mixed $sid = null): string|null
string
the path to check. Can be a "virtual" path (eg. 'image::theme::logo.png'), or a normal path.
string
mixed
string|null
the real absolute path if it's valid, of null if it's not.
getStandardTemplateList(): array<mixed,string>
Throws |
|
---|
array<mixed,string>
getTemplateInFolder(string $folder): \array<string,string>
string
\array
getTemplateInStandard(): \array<string,string>
\array
getTemplateInUpload(): \array<string,string>
\array
getThemeFileInfo(string|null $path,string $themeName,mixed $sid = null): \LimeSurvey\Datavalueobjects\ThemeFileInfo|null
string|null
the path to check. Can be a "virtual" path (eg. 'image::theme::logo.png'), or a normal path.
string
mixed
\LimeSurvey\Datavalueobjects\ThemeFileInfo|null
the file info if it's valid, or null if it's not.
getThemeFileInfoFromAbsolutePath(string $path,array<mixed,\LimeSurvey\Datavalueobjects\ThemeFileCategory> $categoryList): \LimeSurvey\Datavalueobjects\ThemeFileInfo|null|false
The function returns false if the path is not found, and null if it's found but doesn't match a category.
string
array<mixed,\LimeSurvey\Datavalueobjects\ThemeFileCategory>
\LimeSurvey\Datavalueobjects\ThemeFileInfo|null|false
getThemeFileInfoFromRelativePath(string $path,array<mixed,\LimeSurvey\Datavalueobjects\ThemeFileCategory> $categoryList): \LimeSurvey\Datavalueobjects\ThemeFileInfo|false
The function returns false if the path is not relative to any category.
string
array<mixed,\LimeSurvey\Datavalueobjects\ThemeFileCategory>
\LimeSurvey\Datavalueobjects\ThemeFileInfo|false
getThemePath(string $themeName): string
string
string
getVirtualPathPrefix(string $virtualPath): string|null
string
string|null
the virtual path prefix, or null if $virtualPath doesn't match the format
getVirtualThemeFilePath(string $path,string $themeName,mixed $sid = null): string|null
string
the path to check. Can be a "virtual" path (eg. 'image::theme::logo.png'), or a normal path.
string
mixed
string|null
the virtual path if it's valid, of null if it's not.
isStandardTemplate(mixed $themeName): boolean
This function does not check if a template actually exists. Scans standard themes folder and looks for folder matching the $themeName. Important: here is asumed that theme name = folder name
mixed
template name to look for
boolean
True if standard template, otherwise false
isVirtualPath(string $value): boolean
It doesn't check the path validity.
string
boolean
sanitizePathInOption(string $value,string $themeName,string $sid = null): string
Options that match a file will be marked as invalid if the file is not valid, or replaced with the virtual path if the file is valid. The validity of paths depend on the theme configuration (basically the $themeName and the $sid, which could be empty for global options).
string
string
string
string