nouveau module "models" dans l'environnement
[mtweb] / mw / app / out / default / views / config / templates / index.php
index b81e5ad..48e6823 100644 (file)
@@ -1,6 +1,6 @@
 <h2>Template</h2>
 
-<?php if($this->out["out_pathes"]) : ?>
+<?php if($this->out["templates"]) : ?>
 
 <form name="config_form" action="<?php echo $this->url("config/templates"); ?>" method="post">
 
         <label for="out">template</label>
         <?php
   
-          $template = $this->config("out");
+          $current_out_path = $this->config("out");
           $FOUND = false;
-          foreach($this->out["out_pathes"] as $out_path) { if($template == $out_path) { $FOUND = true; break; } }
-          if(!$FOUND) $template = $this->config("default_out");
+          foreach($this->out["templates"] as $out_path => $template) { if($current_out_path == $out_path) { $FOUND = true; break; } }
+          if(!$FOUND) $current_out_path = $this->config("default_out");
         
         ?>
         <div class="form_input">
           <select name="out" id="out">
-            <?php foreach($this->out["out_pathes"] as $out_path) : ?>
-            <option value="<?php echo $out_path; ?>"<?php echo $template == $out_path ? " selected=\"selected\"" : ""; ?>><?php echo $out_path; ?></option>
+            <?php
+
+              foreach($this->out["templates"] as $out_path => $template) :
+                $template_name = $template->get_template_info("name");
+                if(!$template_name) $template_name = $out_path;
+
+            ?>
+            <option value="<?php echo $out_path; ?>"<?php echo $current_out_path == $out_path ? " selected=\"selected\"" : ""; ?>><?php echo $template_name; ?></option>
             <?php endforeach; ?>
           </select>
         </div>