getId(); $name = $template->getName(); $group = $template; $selected = $_REQUEST['code_name']; $action = 'implement'; $extras = array('code_name'=>$selected, 'tpl_id'=>$tpl_id); $msgtemplates=$template::$all_names; $desc = $msgtemplates[$selected]; // Attempt to lookup the default data if it is defined $default = @$template->getMsgTemplate($selected); if ($default) { $info['subject'] = $default->getSubject(); $info['body'] = Format::viewableImages($default->getBody()); } } else { // Template edit $id = $template->getId(); $tpl_id = $template->getTplId(); $name = $template->getGroup()->getName(); $desc = $template->getDescription(); $group = $template->getGroup(); $selected = $template->getCodeName(); $action = 'updatetpl'; $extras = array(); $msgtemplates=$group::$all_names; $info=array_merge(array('subject'=>$template->getSubject(), 'body'=>$template->getBodyWithImages()),$info); } $tpl=$msgtemplates[$selected]; ?>