Exemplo n.º 1
0
 /**
  * Set template var options for page template select menus
  *
  * @param string	$current Name of the template currently stored in the database
  * @return null
  * @access protected
  */
 protected function create_page_template_options($current)
 {
     // Grab all avaliable pages_*.html files
     $page_templates = $this->page_operator->get_page_templates();
     // Clean up template names and simplify the array
     $page_templates = array_map(function ($value) {
         return basename($value);
     }, array_keys($page_templates));
     // Remove duplicates array items
     $page_templates = array_unique($page_templates);
     // Set the options list template vars
     foreach ($page_templates as $page_template) {
         $this->template->assign_block_vars('page_template_options', array('VALUE' => $page_template, 'S_SELECTED' => $page_template == $current));
     }
 }