Ejemplo n.º 1
0
 /**
  * Checks all templates overridden by the user to see if they need an update
  *
  * @param $dirs_to_scan The directories to scan
  *
  * @return array An array containing all the outdated template files found
  */
 public function check_templates($dirs_to_scan)
 {
     $outdated_templates = array();
     foreach ($dirs_to_scan as $dir => $title) {
         $template_finder = new CUAR_TemplateFinder($this);
         $template_finder->scan_directory($dir);
         $tmp = $template_finder->get_outdated_templates();
         if (!empty($tmp)) {
             $outdated_templates[$title] = $tmp;
         }
         unset($template_finder);
     }
     return $outdated_templates;
 }
<p>&nbsp;</p>

<div id="sections_tabs" class="tab-container">
	<ul class="tab-wrapper">
<?php 
foreach ($dirs_to_scan as $dir => $title) {
    printf('<li class="nav-tab"><a href="#section_tab_%1$s">%2$s</a></li>', sanitize_title($title), esc_html($title));
}
?>
	</ul>
	
<?php 
foreach ($dirs_to_scan as $dir => $title) {
    $template_finder = new CUAR_TemplateFinder($this->plugin->get_template_engine());
    $template_finder->scan_directory($dir);
    include_once CUAR_INCLUDES_DIR . '/core-addons/status/template-printer.class.php';
    $template_printer = new CUAR_TemplatePrinter();
    ?>
	<div id="section_tab_<?php 
    echo esc_attr(sanitize_title($title));
    ?>
">	
		<h2><?php 
    printf(__('%s: %d template(s)', 'cuar'), $title, $template_finder->get_template_count());
    ?>
</h2>
		<table class="widefat cuar-templates-table">
<?php 
    $template_printer->print_template_headings();
    $template_printer->print_template_list($template_finder->get_all_templates());