Added default theme kill switch

This commit is contained in:
Christopher Pitt 2015-12-01 10:14:59 +13:00
parent 974f5b7b81
commit 13aefa8f48

View File

@ -79,6 +79,13 @@ class DocumentationViewer extends Controller
*/ */
private static $edit_links = array(); private static $edit_links = array();
/**
* Determines whether css and js files are injected into the document.
*
* @var bool
*/
private static $apply_default_theme = true;
/** /**
* *
*/ */
@ -89,6 +96,8 @@ class DocumentationViewer extends Controller
if (!$this->canView()) { if (!$this->canView()) {
return Security::permissionFailure($this); return Security::permissionFailure($this);
} }
if ($this->config()->apply_default_theme) {
Requirements::javascript('//use.typekit.net/emt4dhq.js'); Requirements::javascript('//use.typekit.net/emt4dhq.js');
Requirements::customScript('try{Typekit.load();}catch(e){}'); Requirements::customScript('try{Typekit.load();}catch(e){}');
@ -105,6 +114,7 @@ class DocumentationViewer extends Controller
DOCSVIEWER_DIR .'/css/small.css' DOCSVIEWER_DIR .'/css/small.css'
)); ));
} }
}
/** /**
* Can the user view this documentation. Hides all functionality for private * Can the user view this documentation. Hides all functionality for private