Table of Contents

Adminskin

Admin code

in ADMIN::pagehead(); the savant object is initialized.

$this->tpl =& new Savant2();
 
$this->tpl->setPath('template', $DIR_ADMIN_THEMES . 'classic/');
if ($CONF['AdminTheme'] != 'classic' && file_exists($DIR_ADMIN_THEMES . $CONF['AdminTheme'] . '/')) {
	$this->tpl->addPath('template', $DIR_ADMIN_THEMES . $CONF['AdminTheme'] . '/');
}
else {
	$CONF['AdminTheme'] = 'classic';
}
 
// Basic vars
$this->tpl->assign('CONF', $CONF);
$this->tpl->assign('nucleus', $nucleus);
$this->tpl->assignRef('member', $member);
$this->tpl->assign('themeBaseUrl', htmlspecialchars($CONF['AdminThemesURL']));
$this->tpl->assign('themeUrl', htmlspecialchars($CONF['AdminThemesURL'] . $CONF['AdminTheme'] . '/'));
$this->tpl->assign('baseUrl', htmlspecialchars($CONF['AdminURL']));
$this->tpl->assign('nucleusversion', getNucleusVersion());
$this->tpl->assign('nucleuspatchlevel', getNucleusPatchLevel());

Use in plugins

the Savant2 object is available:

$pluginadmin->admin->tpl->addPath('template', $DIR_PLUGINS . 'myplugin/skin/');
$pluginadmin->admin->tpl->assign('test', true);
$pluginadmin->admin->tpl->assign('content', 'Hello wo... universe!');
$pluginadmin->admin->tpl->display('plugintest.tpl.php');

in nucleus/plugins/myplugin/skin/plugintest.tpl.php:

<?php
 
if ($this->test == true) {
	echo 'Lo!';
}
 
?>
 
<div id="contentdiv">
	<?php echo($this->content); ?>
</div>
newadmin/adminskin.txt · Last modified: 2006/07/05 13:03 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki