AdminTheme

Extends \CFormModel

Admin Theme Model

package

LimeSurvey

subpackage

Backend

Methods

Get the list of admin theme, as an array containing each configuration object for each template

getAdminThemeList() : array
static

Response

array

the array of configuration object

Set the Admin Theme : - checks if the required template exists - set the admin theme variables - set the admin theme constants - Register all the needed CSS/JS files

setAdminTheme() 

Register all the styles and scripts of the current template.

registerStylesAndScripts() 

Check if RTL is needed, use asset manager if needed. This function is public because it appears that sometime, the package need to be register again in header (probably a cache problem)

Register a JS File from the correct directory (publict style, style, upload, etc) using the correct method (with / whithout asset manager) This function is called from the different controllers when they want to register a specific css file.

registerCssFile($sPath = 'template', $sFile = '') 
var

'PUBLIC' for /styles-public/, else templates/styles ('PUBLIC' is an heritage from 2.06, which was using constants to that goal.)

the name of the css file

Arguments

$sPath

$sFile

registerScriptFile

registerScriptFile(string $cPATH, string $sFile) 

Arguments

$cPATH

string

$sFile

string

Register a Css File from the correct directory (publict style, style, upload, etc) using the correct method (with / whithout asset manager) This function is called from the different controllers when they want to register a specific css file Static method is necessary to avoid to init the admin theme to register admin_core script.

staticRegisterScriptFile(string $cPATH, string $sFile) 
static

.. (see: AdminController::_init())

var

'SCRIPT_PATH' for root/scripts/ ; 'ADMIN_SCRIPT_PATH' for root/scripts/admin/; else templates/scripts (uppercase is an heritage from 2.06, which was using constants )

the name of the js file

Arguments

$cPATH

string

$sFile

string

Get instance of theme object.

getInstance() : \AdminTheme
static

Will instantiate the Admin Theme object first time it is called. Please use this instead of global variable.

Response

\AdminTheme

Touch each directory in standard admin theme directory to force assset manager to republish them NB: This function still makes problem, because it's touching direcories inside application, which could be unwritable.

forceAssets() 
static

But: if people used comfortUpdate, the probably made it writable TODO: check if 'force' parameter could be used to publish new assets here see: http://www.yiiframework.com/doc/api/1.1/CAssetManager#forceCopy-detail

touchSubDirectories

touchSubDirectories($sPath) 
static

Arguments

$sPath

getOtherAssets

getOtherAssets() 
static

Return an array containing the configuration object of all templates in a given directory

getThemeList(string $sDir) : array
static

Arguments

$sDir

string

the directory to scan

Response

array

the array of object

Few constants depending on Template

defineConstants() 

Use to check if admin theme is standard

isStandardAdminTheme($sAdminThemeName) : boolean
var

the name of the template

Arguments

$sAdminThemeName

Response

boolean

return true if it's a standard template, else false

Properties

name

name : 

path

path : 

sTemplateUrl

sTemplateUrl : 

config

config : 

use_asset_manager

use_asset_manager : 
static

instance

instance : 
static