New domain: Add information if no ISO image is present
authorMichal Novotny <minovotn@redhat.com>
Sat, 4 Aug 2012 10:12:01 +0000 (12:12 +0200)
committerMichal Novotny <minovotn@redhat.com>
Mon, 6 Aug 2012 07:32:33 +0000 (09:32 +0200)
Signed-off-by: Michal Novotny <mignov@gmail.com>
Signed-off-by: Michal Novotny <minovotn@redhat.com>

classes/language.php
lang/cs.php
lang/en.php
pages/new-vm.php

index f8ec2b9..94f66e0 100644 (file)
@@ -29,6 +29,7 @@
                                        'conn_encrypted' => 'Encrypted',
                                        'conn_secure' => 'Secure',
                                        'connected_to' => 'Connected to',
+                                       'no_iso' => 'No ISO install image is present',
                                        'hypervisor_limit' => 'Hypervisor limit',
                                        'hostname' => 'Hostname',
                                        'password' => 'Password',
index f212aee..f841658 100644 (file)
@@ -11,6 +11,7 @@
                                        'conn_encrypted' => 'Šifrování',
                                        'conn_secure' => 'Zabezpečení',
                                        'connected_to' => 'Připojeno k',
+                                       'no_iso' => 'Nebyl nalezen žádný instalační obraz ISO',
                                        'hypervisor_limit' => 'Limit hypervisoru',
                                        'hostname' => 'Jméno hostitele',
                                        'password' => 'Heslo',
index 28e981e..e178067 100644 (file)
@@ -10,6 +10,7 @@
                                        'conn_encrypted' => 'Encrypted',
                                        'conn_secure' => 'Secure',
                                        'connected_to' => 'Connected to',
+                                       'no_iso' => 'No ISO install image is present',
                                        'hypervisor_limit' => 'Hypervisor limit',
                                        'hostname' => 'Hostname',
                                        'password' => 'Password',
index 70c82bf..b0591ca 100644 (file)
        }
   }
 
-  $isos = libvirt_get_iso_images();
-
-  $ci  = $lv->get_connect_information();
-  $maxcpu = $ci['hypervisor_maxvcpus'];
-  unset($ci);
+    $isos = libvirt_get_iso_images();
+
+    $nodetails = false;
+    if (empty($isos)) {
+      $msg = $lang->get('no_iso');
+      $skip = true;
+      $nodetails = true;
+    } else {
+      $ci  = $lv->get_connect_information();
+      $maxcpu = $ci['hypervisor_maxvcpus'];
+      unset($ci);
+    }
 ?>
 
 <?php
 
 <?php
   else:
+      if (!$nodetails):
 ?>
   <br /><a href="?name=<?php echo $_POST['name'] ?>"><?php echo $lang->get('vm_details') ?></a>
 <?php
+      endif;
   endif;
 ?>