templator = new dcTemplator($core); $core->addBehavior('initWidgets',array('templatorWidgets','initWidgets')); class templatorWidgets { public static function initWidgets($w) { $w->create('templatorWidget',__('Templator › Rendering'),array('widgetTemplator','getDataTpl')); $tpl = array('      .html' => ''); foreach ($GLOBALS['core']->templator->tpl as $k => $v) { if (preg_match('/^widget-(.+)$/',$k)) { $tpl = array_merge($tpl, array($k => $k)); } } $w->templatorWidget->setting('template',__('Template:'),'','combo',$tpl); } } class widgetTemplator { public static function getDataTpl($w) { if (($GLOBALS['core']->tpl->getFilePath($w->template))) { echo $GLOBALS['core']->tpl->getData($w->template); } } } ?>