function execute($requests) { $name = sprintf('inc_entry_point_%s_%d', $requests['target'], $requests['num']); $this->set('source', db_get_c_template_source($name)); $this->set('entry_point_list', get_inc_entry_point_list()); return 'success'; }
function fetch_inc_entry_point(&$smarty, $target) { $list = get_inc_entry_point_list(); if (empty($list[$target])) { return false; } list($start, $end, $caption) = $list[$target]; $contents = array(); for ($i = (int) $start; $i <= (int) $end; $i++) { $tpl = sprintf('db:inc_entry_point_%s_%d', $target, $i); $contents[$i] = fetch_from_db($tpl, $smarty); } return $contents; }