Example #1
0
 public function render(EGlet &$eglet, &$smarty)
 {
     if ($eglet->should_render) {
         $smarty->assign('source', $eglet->getSource());
         $smarty->display('eglets/xml_swf_chart.tpl');
     }
 }
Example #2
0
 public function render(EGlet &$eglet, &$smarty)
 {
     if ($eglet->should_render) {
         // clear all previous smarty vars
         // just to stop 'cross contamination' of vars
         $self = $smarty->getTemplateVars('self');
         $action = $smarty->getTemplateVars('action');
         $module = $smarty->getTemplateVars('module');
         $controller = $smarty->getTemplateVars('controller');
         $smarty->clearAllAssign();
         $vars = $eglet->get_vars();
         // loop through the vars array and assign them in smarty
         if (!empty($vars)) {
             foreach ($vars as $key => $var) {
                 $smarty->assign($key, $var);
             }
         }
         $smarty->assign('content', $eglet->getContents());
         $smarty->assign('self', $self);
         $smarty->assign('action', $action);
         if (!isset($vars['module'])) {
             $smarty->assign('module', $module);
         }
         if (!isset($vars['controller'])) {
             $smarty->assign('controller', $controller);
         }
         $smarty->cache_lifetime = 200;
         echo $smarty->fetch($eglet->getTemplate());
     }
 }
Example #3
0
 public function render(EGlet &$eglet, &$smarty)
 {
     $json_options = $eglet->getContents();
     $options = json_decode($json_options);
     $smarty->assign('identifier', $options->identifier);
     $smarty->assign('options', $json_options);
     switch (strtolower($options->type)) {
         case 'pie':
             $smarty->display('eglets/eglet_pie_chart.tpl');
             break;
         case 'bar':
             $smarty->display('eglets/eglet_bar_chart.tpl');
             break;
         case 'line':
             $smarty->display('eglets/eglet_line_chart.tpl');
             break;
     }
 }