http://api.contenido.org/con492/class-cGuiPage.html
Ich finde diese Funktionen sind noch nicht vollständig, da ein Feedback fehlt, wenn eine Datei nicht vorhanden ist.
Dies sollte dann zumindest über cError oder cWarnings in das Log, besser noch zusätzlich optional über ein debug-Flag zuschaltbar sein.
Mal exemplarisch das assScript:
Code: Alles auswählen
public function addScript($script) {
$cfg = cRegistry::getConfig();
$backendUrl = cRegistry::getBackendUrl();
$backendPath = cRegistry::getBackendPath();
if (strpos(trim($script), 'http') === 0 || strpos(trim($script), '<script') === 0 || strpos(trim($script), '//') === 0) {
if (strpos(trim($script), '<script') === 0) {
cDeprecated("You shouldn't use inline JS for backend pages");
}
// the given script path is absolute
$this->_scripts[] = $script;
} else if (cFileHandler::exists($backendPath . $cfg['path']['plugins'] . $this->_pluginname . '/' . $cfg['path']['scripts'] . $script)) {
// the given script path is relative to the plugin scripts folder
$fullpath = $backendUrl . $cfg['path']['plugins'] . $this->_pluginname . '/' . $cfg['path']['scripts'] . $script;
$this->_scripts[] = $fullpath;
} else if (cFileHandler::exists($backendPath . $cfg['path']['scripts'] . $script)) {
// the given script path is relative to the CONTENIDO scripts folder
$fullpath = $backendUrl . $cfg['path']['scripts'] . $script;
$this->_scripts[] = $fullpath;
}
}
Code: Alles auswählen
else {
cError(__FILE__, __LINE__, 'Including Script ('.$script.') Error: File not found. ');
}