Polish code and divide functionality into libvirt-{domain|info|network} classes
authorMichal Novotny <minovotn@redhat.com>
Sat, 22 Sep 2012 21:42:11 +0000 (23:42 +0200)
committerMichal Novotny <minovotn@redhat.com>
Sat, 22 Sep 2012 21:47:08 +0000 (23:47 +0200)
Signed-off-by: Michal Novotny <minovotn@redhat.com>

36 files changed:
classes/language.php
classes/libvirt-domain.php [new file with mode: 0644]
classes/libvirt-info.php [new file with mode: 0644]
classes/libvirt-network.php [new file with mode: 0644]
classes/libvirt.php
classes/loggerBase.php [new file with mode: 0644]
dialog-login.php
error-connection-db.php
error-missing.php
error-need-update.php
error.php
functions.php
index.php
init.php
lang/cs.php
lang/en.php
main-menu.php
manager.css
menu.php
pages/details/boot-options.php
pages/details/disk-devices.php
pages/details/host-devices.php
pages/details/memory.php
pages/details/multimedia-devices.php
pages/details/network-devices.php
pages/details/overview.php
pages/details/processor.php
pages/details/screenshot.php
pages/domain-list.php
pages/info.php
pages/network-list.php
pages/new-net.php
pages/new-vm.php
pages/overview.php
pages/settings.php
pages/users.php

index 536f2f1..bc73425 100644 (file)
                function initlang() {
                        /* Default to English however implemented in here as well for case lang directory is missing */
                        $trans = array(
-                                       'title_vmc' => 'Virtual Machine Controller',
+                                       'title-vmc' => 'Virtual Machine Controller',
                                        'info'   => 'Information',
-                                       'for_php' => 'for PHP',
-                                       'conn_details' => 'Connection details',
-                                       'conn_uri' => 'Connection URI',
-                                       'conn_encrypted' => 'Encrypted',
-                                       'conn_secure' => 'Secure',
-                                       'connected_to' => 'Connected to',
-                                       'no_iso' => 'No ISO install image is present',
-                                       'hypervisor_limit' => 'Hypervisor limit',
+                                       'for-php' => 'for PHP',
+                                       'conn-details' => 'Connection details',
+                                       'conn-uri' => 'Connection URI',
+                                       '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',
                                        'Yes' => 'Yes',
                                        'No' => 'No',
-                                       'error_page_title' => 'Error',
-                                       'error_connection_db_label' => 'DB Error',
-                                       'error_connection_db_text' => 'The connection to your database has failed.',
+                                       'error-page-title' => 'Error',
+                                       'error-connection-db-label' => 'DB Error',
+                                       'error-connection-db-text' => 'The connection to your database has failed.',
                                        'no-datafile' => 'Data file is missing.',
                                        'no-server' => 'Server definition is missing in the data file.',
                                        'no-user' => 'User definition is missing in the data file.',
                                        'no-dbname' => 'Database name definition is missing in the data file.',
                                        'db-failure-connect' => 'Cannot connect to database. Please check your configuration.',
                                        'db-failure-select' => 'Cannot select database name. Please check your configuration.',
-                                       'error_page_label' => 'Page not found:',
-                                       'error_page_text' => 'The page you were looking for was not found. Please report to the administrator and try again later.',
-                                       'error_missing_label' => 'Missing dependency:',
-                                       'error_missing_text' => 'Your PHP configuration is missing libvirt-php module which is necessary to maintain virtual machines. Please install libvirt-php from <a href="http://libvirt.org/php">http://libvirt.php</a> first.',
-                                       'error_need_update_label' => 'Update needed:',
-                                       'error_need_update_text' => 'Your version of libvirt-php module is too old for this application to work properly. Please upgrade your libvirt-php version from <a href="http://libvirt.org/php">http://libvirt.php</a> first.',
-                                       'host_details' => 'Host details',
+                                       'error-page-label' => 'Page not found:',
+                                       'error-page-text' => 'The page you were looking for was not found. Please report to the administrator and try again later.',
+                                       'error-missing-label' => 'Missing dependency:',
+                                       'error-missing-text' => 'Your PHP configuration is missing libvirt-php module which is necessary to maintain virtual machines. Please install libvirt-php from <a href="http://libvirt.org/php">http://libvirt.php</a> first.',
+                                       'error-need-update-label' => 'Update needed:',
+                                       'error-need-update-text' => 'Your version of libvirt-php module is too old for this application to work properly. Please upgrade your libvirt-php version from <a href="http://libvirt.org/php">http://libvirt.php</a> first.',
+                                       'host-details' => 'Host details',
                                        'model' => 'Model',
                                        'pcpus' => 'CPUs/cores',
-                                       'cpu_speed' => 'CPU Speed',
+                                       'cpu-speed' => 'CPU Speed',
                                        'modinfo' => 'libvirt PHP module information',
                                        'version' => 'Version',
                                        'website' => 'Website',
-                                       'pool_not_running' => 'Not running',
-                                       'pool_building' => 'Building pool',
-                                       'pool_running' => 'Running',
-                                       'pool_running_deg' => 'Running degraded',
-                                       'pool_running_inac' => 'Running but inaccessible',
+                                       'pool-not-running' => 'Not running',
+                                       'pool-building' => 'Building pool',
+                                       'pool-running' => 'Running',
+                                       'pool-running-deg' => 'Running degraded',
+                                       'pool-running-inac' => 'Running but inaccessible',
                                        'unknown' => 'Unknown',
-                                       'dom_running' => 'running',
-                                       'dom_nostate' => 'no state',
-                                       'dom_blocked' => 'blocked',
-                                       'dom_paused' =>  'paused',
-                                       'dom_shutdown' => 'shutdown',
-                                       'dom_shutoff' => 'shutoff',
-                                       'dom_crashed' => 'crashed',
-                                       'cur_phys_size' => 'Current physical size',
+                                       'dom-running' => 'running',
+                                       'dom-nostate' => 'no state',
+                                       'dom-blocked' => 'blocked',
+                                       'dom-paused' =>  'paused',
+                                       'dom-shutdown' => 'shutdown',
+                                       'dom-shutoff' => 'shutoff',
+                                       'dom-crashed' => 'crashed',
+                                       'cur-phys-size' => 'Current physical size',
                                        'diskless' => 'diskless',
                                        'changes' => 'Changes',
-                                       'btn_apply' => 'Apply changes',
-                                       'btn_discard' => 'Discard changes',
-                                       'ask_apply' => 'Do you really want to apply your changes?',
-                                       'ask_discard' => 'Do you really want to discard your changes?',
+                                       'btn-apply' => 'Apply changes',
+                                       'btn-discard' => 'Discard changes',
+                                       'ask-apply' => 'Do you really want to apply your changes?',
+                                       'ask-discard' => 'Do you really want to discard your changes?',
                                        'general' => 'General',
                                        'description' => 'Description',
-                                       'vm_details' => 'Machine details',
-                                       'host_pcpu_info' => 'Host processor information',
-                                       'max_per_guest' => 'Max. per guest',
-                                       'vm_vcpu_info' => 'Machine processor information',
-                                       'host_mem_info' => 'Host memory information',
-                                       'vm_mem_info' => 'Machine memory information',
-                                       'total_mem' => 'Total memory',
-                                       'mem_alloc_cur' => 'Current allocation',
-                                       'mem_alloc_max' => 'Max. allocation',
-                                       'vm_boot_opts' => 'Virtual machine boot options',
-                                       'vm_boot_dev1' => 'First boot device',
-                                       'vm_boot_dev2' => 'Second boot device',
-                                       'vm_boot_hdd' => 'Hard-drive',
-                                       'vm_boot_cd' => 'CD-ROM',
-                                       'vm_boot_fda' => 'Floppy',
-                                       'vm_boot_pxe' => 'Network boot (PXE)',
-                                       'vm_boot_none' => 'none',
-                                       'vm_disk_num' => 'Number of disks',
-                                       'vm_disk_storage' => 'Storage',
-                                       'vm_disk_type' => 'Driver type',
-                                       'vm_disk_dev' => 'Domain device',
-                                       'vm_disk_capacity' => 'Capacity',
-                                       'vm_disk_allocation' => 'Allocation',
-                                       'vm_disk_physical' => 'Physical disk size',
-                                       'vm_disk_remove' => 'Remove disk',
-                                       'vm_disk_add' => 'Add new disk',
-                                       'vm_disk_image' => 'Disk image',
-                                       'vm_disk_location' => 'Disk location',
-                                       'vm_disk_details' => 'Machine disk device details',
-                                       'vm_disk_askdel' => 'Are you sure you want to delete disk \'+disk+\' from the guest?',
-                                       'vm_disk_askadd' => 'Are you sure you want to add disk to the guest?',
-                                       'vm_network_title' => 'Machine network devices',
-                                       'vm_network_num' => 'Number of NICs',
-                                       'vm_network_nic' => 'Network interface card ',
-                                       'vm_network_mac' => 'MAC Address',
-                                       'vm_network_net' => 'Network',
-                                       'vm_network_type' => 'NIC Type',
-                                       'vm_network_add' => 'Add a new network interface',
-                                       'vm_network_del' => 'Remove network interface',
-                                       'vm_network_askadd' => 'Do you really want to add a new network interface card ?',
-                                       'vm_network_askdel' => 'Are you sure you want to delete interface with MAC address \'+mac+\' from the guest?',
-                                       'vm_title' => 'Virtual machine',
-                                       'vm_multimedia_title' => 'Machine multimedia devices',
-                                       'vm_multimedia_console' => 'Console',
-                                       'vm_multimedia_input' => 'Input device',
-                                       'vm_multimedia_graphics' => 'Graphics device',
-                                       'vm_multimedia_video' => 'Video device',
-                                       'details_readonly' => 'None (this page is currently read-only)',
-                                       'host_devices_title' => 'Machine host devices',
-                                       'host_devices' => 'Host devices',
+                                       'vm-details' => 'Machine details',
+                                       'host-pcpu-info' => 'Host processor information',
+                                       'max-per-guest' => 'Max. per guest',
+                                       'vm-vcpu-info' => 'Machine processor information',
+                                       'host-mem-info' => 'Host memory information',
+                                       'vm-mem-info' => 'Machine memory information',
+                                       'total-mem' => 'Total memory',
+                                       'mem-alloc-cur' => 'Current allocation',
+                                       'mem-alloc-max' => 'Max. allocation',
+                                       'vm-boot-opts' => 'Virtual machine boot options',
+                                       'vm-boot-dev1' => 'First boot device',
+                                       'vm-boot-dev2' => 'Second boot device',
+                                       'vm-boot-hdd' => 'Hard-drive',
+                                       'vm-boot-cd' => 'CD-ROM',
+                                       'vm-boot-fda' => 'Floppy',
+                                       'vm-boot-pxe' => 'Network boot (PXE)',
+                                       'vm-boot-none' => 'none',
+                                       'vm-disk-num' => 'Number of disks',
+                                       'vm-disk-storage' => 'Storage',
+                                       'vm-disk-type' => 'Driver type',
+                                       'vm-disk-dev' => 'Domain device',
+                                       'vm-disk-capacity' => 'Capacity',
+                                       'vm-disk-allocation' => 'Allocation',
+                                       'vm-disk-physical' => 'Physical disk size',
+                                       'vm-disk-remove' => 'Remove disk',
+                                       'vm-disk-add' => 'Add new disk',
+                                       'vm-disk-image' => 'Disk image',
+                                       'vm-disk-location' => 'Disk location',
+                                       'vm-disk-details' => 'Machine disk device details',
+                                       'vm-disk-askdel' => 'Are you sure you want to delete disk \'+disk+\' from the guest?',
+                                       'vm-disk-askadd' => 'Are you sure you want to add disk to the guest?',
+                                       'vm-network-title' => 'Machine network devices',
+                                       'vm-network-num' => 'Number of NICs',
+                                       'vm-network-nic' => 'Network interface card ',
+                                       'vm-network-mac' => 'MAC Address',
+                                       'vm-network-net' => 'Network',
+                                       'vm-network-type' => 'NIC Type',
+                                       'vm-network-add' => 'Add a new network interface',
+                                       'vm-network-del' => 'Remove network interface',
+                                       'vm-network-askadd' => 'Do you really want to add a new network interface card ?',
+                                       'vm-network-askdel' => 'Are you sure you want to delete interface with MAC address \'+mac+\' from the guest?',
+                                       'vm-title' => 'Virtual machine',
+                                       'vm-multimedia-title' => 'Machine multimedia devices',
+                                       'vm-multimedia-console' => 'Console',
+                                       'vm-multimedia-input' => 'Input device',
+                                       'vm-multimedia-graphics' => 'Graphics device',
+                                       'vm-multimedia-video' => 'Video device',
+                                       'details-readonly' => 'None (this page is currently read-only)',
+                                       'host-devices-title' => 'Machine host devices',
+                                       'host-devices' => 'Host devices',
                                        'settings' => 'Settings',
-                                       'interval_sec' => 'Interval (sec)',
+                                       'interval-sec' => 'Interval (sec)',
                                        'change' => 'Change',
-                                       'menu_overview' => 'Overview',
-                                       'menu_processor' => 'Processor',
-                                       'menu_memory' => 'Memory',
-                                       'menu_boot' => 'Boot options',
-                                       'menu_disk' => 'Disk devices',
-                                       'menu_network' => 'Network devices',
-                                       'menu_multimedia' => 'Multimedia devices',
-                                       'menu_hostdev' => 'Host devices',
-                                       'menu_screenshot' => 'Screenshot',
-                                       'info_msg' => '<p>This is the virtual machine controller tool written in PHP language.'.
+                                       'menu-overview' => 'Overview',
+                                       'menu-processor' => 'Processor',
+                                       'menu-memory' => 'Memory',
+                                       'menu-boot' => 'Boot options',
+                                       'menu-disk' => 'Disk devices',
+                                       'menu-network' => 'Network devices',
+                                       'menu-multimedia' => 'Multimedia devices',
+                                       'menu-hostdev' => 'Host devices',
+                                       'menu-screenshot' => 'Screenshot',
+                                       'info-msg' => '<p>This is the virtual machine controller tool written in PHP language.'.
                                                        'You can manage virtual machines (guests) on your machines using this web-based '.
                                                        'controlling interface. For the navigation please use the upper menu and select '.
                                                        'the domain from the <i>Domain list</i> link to see the virtual machines available '.
                                        'conns'  => 'Connections',
                                        'connname' => 'Connection name',
                                        'hypervisor' => 'Hypervisor',
-                                       'host_type' => 'Host type',
-                                       'type_local' => 'Local',
-                                       'type_remote' => 'Remote',
+                                       'host-type' => 'Host type',
+                                       'type-local' => 'Local',
+                                       'type-remote' => 'Remote',
                                        'host' => 'Host',
                                        'logfile' => 'Log file',
                                        'actions' => 'Actions',
-                                       'log_opts' => 'Logging options',
-                                       'host_opts' => 'Host options',
-                                       'save_conn' => 'Save connection',
-                                       'connect_new' => 'Connect to the new host',
-                                       'change_conn' => 'Change host connection',
-                                       'conn_method' => 'Connection method',
+                                       'log-opts' => 'Logging options',
+                                       'host-opts' => 'Host options',
+                                       'save-conn' => 'Save connection',
+                                       'connect-new' => 'Connect to the new host',
+                                       'change-conn' => 'Change host connection',
+                                       'conn-method' => 'Connection method',
                                        'user' => 'User name',
-                                       'conn_setup' => 'Setup connection',
+                                       'conn-setup' => 'Setup connection',
                                        'connect' => 'Connect',
-                                       'conn_remove' => 'Remove connection',
-                                       'empty_disable_log' => 'Leave empty to disable logging',
-                                       'empty_disable_save' => 'Leave empty not to save connection',
-                                       'conn_none' => 'No connection defined',
-                                       'hostdev_none' => 'None',
+                                       'conn-remove' => 'Remove connection',
+                                       'empty-disable-log' => 'Leave empty to disable logging',
+                                       'empty-disable-save' => 'Leave empty not to save connection',
+                                       'conn-none' => 'No connection defined',
+                                       'hostdev-none' => 'None',
                                        'name'   => 'Name',
                                        'arch'   => 'Architecture',
                                        'vcpus'  => 'vCPUs',
                                        'state'  => 'State',
                                        'id'     => 'ID',
                                        'msg'    => 'Message',
-                                       'dom_start' => 'Start domain',
-                                       'dom_stop'  => 'Stop domain',
-                                       'dom_destroy' => 'Destroy domain',
-                                       'dom_dumpxml' => 'Dump domain XML',
-                                       'dom_editxml' => 'Edit domain XML',
-                                       'dom_xmldesc' => 'Domain XML description',
-                                       'dom_undefine' => 'Undefine domain',
-                                       'dom_start_ok' => 'Domain has been started successfully',
-                                       'dom_start_err' => 'Error while starting domain',
-                                       'dom_shutdown_ok' => 'Command to shutdown domain sent successfully',
-                                       'dom_shutdown_err' => 'Error while sending shutdown command',
-                                       'dom_destroy_ok' => 'Domain has been destroyed successfully',
-                                       'dom_destroy_err' => 'Error while destroying domain',
-                                       'dom_undefine_ok' => 'Domain has been undefined successfully',
-                                       'dom_undefine_err' => 'Error while undefining domain',
-                                       'dom_define_changed' => 'Domain definition has been changed',
-                                       'dom_define_change_err' => 'Cannot change domain definition',
-                                       'dom_undefine_question' => 'You can delete the domain with or without disks assigned to the domain. If you select option to delete disks only the domain disks will get deleted and the CD-ROM images will be intact. Are you sure you want to delete (undefine) this domain?',
+                                       'dom-start' => 'Start domain',
+                                       'dom-stop'  => 'Stop domain',
+                                       'dom-destroy' => 'Destroy domain',
+                                       'dom-dumpxml' => 'Dump domain XML',
+                                       'dom-editxml' => 'Edit domain XML',
+                                       'dom-xmldesc' => 'Domain XML description',
+                                       'dom-undefine' => 'Undefine domain',
+                                       'dom-start-ok' => 'Domain has been started successfully',
+                                       'dom-start-err' => 'Error while starting domain',
+                                       'dom-shutdown-ok' => 'Command to shutdown domain sent successfully',
+                                       'dom-shutdown-err' => 'Error while sending shutdown command',
+                                       'dom-destroy-ok' => 'Domain has been destroyed successfully',
+                                       'dom-destroy-err' => 'Error while destroying domain',
+                                       'dom-undefine-ok' => 'Domain has been undefined successfully',
+                                       'dom-undefine-err' => 'Error while undefining domain',
+                                       'dom-define-changed' => 'Domain definition has been changed',
+                                       'dom-define-change-err' => 'Cannot change domain definition',
+                                       'dom-undefine-question' => 'You can delete the domain with or without disks assigned to the domain. If you select option to delete disks only the domain disks will get deleted and the CD-ROM images will be intact. Are you sure you want to delete (undefine) this domain?',
                                        'delete' => 'Delete',
-                                       'delete_with_disks' => 'Delete with disks',
-                                       'changed_uri' => 'Changed connection URI to',
-                                       'click_reload' => 'Click here to reload and connect using new URI',
-                                       'conn_saved' => 'Connection has been saved to the list.',
-                                       'conn_failed' => 'Connection has failed',
-                                       'domain_list' => 'Domain list',
-                                       'dom_screenshot' => 'Screenshot',
-                                       'network_list' => 'Network list',
-                                       'dom_none' => 'No valid domain defined',
-                                       'main_menu' => 'Main menu',
-                                       'cannot_connect' => 'Cannot connect to hypervisor. Please change connection information.',
+                                       'delete-with-disks' => 'Delete with disks',
+                                       'changed-uri' => 'Changed connection URI to',
+                                       'click-reload' => 'Click here to reload and connect using new URI',
+                                       'conn-saved' => 'Connection has been saved to the list.',
+                                       'conn-failed' => 'Connection has failed',
+                                       'domain-list' => 'Domain list',
+                                       'dom-screenshot' => 'Screenshot',
+                                       'network-list' => 'Network list',
+                                       'dom-none' => 'No valid domain defined',
+                                       'main-menu' => 'Main menu',
+                                       'cannot-connect' => 'Cannot connect to hypervisor. Please change connection information.',
                                        'language' => 'Language',
-                                       'usig-ssh-auth' => 'Using SSH authentication',
+                                       'using-ssh-auth' => 'Using SSH authentication',
                                        'info-apache-key-copy' => 'There\'s an utility called <b>apache-key-copy</b> included to this web-application (can be found in tools subdir)'.
                                                                'that\'s useful to setup SSH keys for password-less SSH connection. The SSH connection '.
                                                                'transport <b>does not</b> support passing credentials to the SSH process and that\'s why '.
                                        'new-vm-existing' => 'Use existing disk image',
                                        'new-vm-create' => 'Create new disk image',
                                        'vm-disk-size' => 'New disk size',
-                                       'net_ip' => 'IP Address',
-                                       'net_mask' => 'Subnet mask',
-                                       'net_range' => 'IP Range',
-                                       'net_forward' => 'Forwarding',
-                                       'net_dev' => 'Forwarding to device',
-                                       'net_dhcp_range' => 'DHCP Range',
-                                       'net_active' => 'Active',
+                                       'net-ip' => 'IP Address',
+                                       'net-mask' => 'Subnet mask',
+                                       'net-range' => 'IP Range',
+                                       'net-forward' => 'Forwarding',
+                                       'net-dev' => 'Forwarding to device',
+                                       'net-dhcp-range' => 'DHCP Range',
+                                       'net-active' => 'Active',
                                        'create-new-network' => 'Create a new network',
-                                       'net_start' => 'Start network',
-                                       'net_dumpxml' => 'Dump network XML',
-                                       'net_editxml' => 'Edit network XML',
-                                       'net_undefine' => 'Undefine network',
-                                       'net_stop' => 'Stop network',                                   
-                                       'net_xmldesc' => 'Network XML description',
-                                       'net_editxml' => 'Edit network XML description',
-                                       'net_define_changed' => 'Network definition changed',
-                                       'net_define_change_err' => 'Error occurred while changing network definition',
-                                       'net_start_ok' => 'Network has been started successfully',
-                                       'net_start_err' => 'An error occurred while starting the network',
-                                       'net_stop_ok' => 'Network has been stopped successfully',
-                                       'net_stop_err' => 'An error occurred while stopping the network',
-                                       'net_undefine_question' => 'Do you really want to undefine this network?',
-                                       'net_undefine_ok' => 'Network has been successfully undefined',
-                                       'net_undefine_err' => 'An error occurred while undefining the network',
-                                       'net_ip_range_def' => 'IP Range definition',
-                                       'net_ip_cidr' => 'CIDR (192.168.111.0/24)',
-                                       'net_ip_direct' => 'IP and mask definition',
-                                       'net_ipdef_cidr' => 'CIDR Definition',
+                                       'net-start' => 'Start network',
+                                       'net-dumpxml' => 'Dump network XML',
+                                       'net-editxml' => 'Edit network XML',
+                                       'net-undefine' => 'Undefine network',
+                                       'net-stop' => 'Stop network',
+                                       'net-xmldesc' => 'Network XML description',
+                                       'net-editxml' => 'Edit network XML description',
+                                       'net-define-changed' => 'Network definition changed',
+                                       'net-define-change-err' => 'Error occurred while changing network definition',
+                                       'net-start-ok' => 'Network has been started successfully',
+                                       'net-start-err' => 'An error occurred while starting the network',
+                                       'net-stop-ok' => 'Network has been stopped successfully',
+                                       'net-stop-err' => 'An error occurred while stopping the network',
+                                       'net-undefine-question' => 'Do you really want to undefine this network?',
+                                       'net-undefine-ok' => 'Network has been successfully undefined',
+                                       'net-undefine-err' => 'An error occurred while undefining the network',
+                                       'net-ip-range-def' => 'IP Range definition',
+                                       'net-ip-cidr' => 'CIDR (192.168.111.0/24)',
+                                       'net-ip-direct' => 'IP and mask definition',
+                                       'net-ipdef-cidr' => 'CIDR Definition',
                                        'dhcp' => 'DHCP',
-                                       'net_dhcp_start' => 'DHCP Range start',
-                                       'net_dhcp_end' => 'DHCP Range end',
-                                       'net_forward_none' => 'none',
-                                       'net_forward_nat' => 'NAT',
-                                       'net_forward_route' => 'Route',
-                                       'net_forward_dev_empty_msg' => 'Leave empty for forwarding to any device/interface',
-                                       'net_forward_dev_any' => 'any interface / device',
-                                       'net_created' => 'Network has been created successfully',
+                                       'net-dhcp-start' => 'DHCP Range start',
+                                       'net-dhcp-end' => 'DHCP Range end',
+                                       'net-forward-none' => 'none',
+                                       'net-forward-nat' => 'NAT',
+                                       'net-forward-route' => 'Route',
+                                       'net-forward-dev-empty-msg' => 'Leave empty for forwarding to any device/interface',
+                                       'net-forward-dev-any' => 'any interface / device',
+                                       'net-created' => 'Network has been created successfully',
                                        'new-vm-created' => 'New virtual machine has been created successfully',
                                        'network-add-ok' => 'Network card has been successfully added to the guest. Changes will take effect on next domain startup.',
                                        'network-add-error' => 'Cannot add NIC to the guest',
                                        'network-generate-mac' => 'Generate new MAC address',
                                        'network-remove-ok' => 'Network card has been removed successfully. Changes will take effect on next domain startup.',
                                        'network-remove-error' => 'Cannot remove disk',
-                                       'login_page_title' => 'Log-in',
-                                       'login_enter_login' => 'Login:',
-                                       'login_enter_password' => 'Password:',
-                                       'login_submit' => 'Login',
-                                       'login_invalid' => 'Your credentials are not valid. Please provide valid credentials',
+                                       'login-page-title' => 'Log-in',
+                                       'login-enter-login' => 'Login:',
+                                       'login-enter-password' => 'Password:',
+                                       'login-submit' => 'Login',
+                                       'login-invalid' => 'Your credentials are not valid. Please provide valid credentials',
                                        'logout' => 'Logout',
-
                                        'users' => 'Users',
                                        'create-new-user' => 'Create a new user',
-                                       'user_add' => 'Add user',
-                                       'user_edit' => 'Edit user',
-                                       'user_del' => 'Delete user',
-                                       'user_del_confirm' => 'Do you really want to delete selected user?',
-                                       'user_added' => 'User has been successfully added',
-                                       'user_edited' => 'User information has been successfully changed',
-                                       'user_deleted' => 'User has been succesfully deleted',
-                                       'confirm_password' => 'Confirm password',
+                                       'user-add' => 'Add user',
+                                       'user-edit' => 'Edit user',
+                                       'user-del' => 'Delete user',
+                                       'user-del-confirm' => 'Do you really want to delete selected user?',
+                                       'user-added' => 'User has been successfully added',
+                                       'user-edited' => 'User information has been successfully changed',
+                                       'user-deleted' => 'User has been succesfully deleted',
+                                       'confirm-password' => 'Confirm password',
                                        'permissions' => 'Permissions',
-                                       'permission_basic' => 'Basic access',
-                                       'permission_save_connection' => 'Save connection',
-                                       'permission_vm_create' => 'Create virtual machine',
-                                       'permission_vm_edit' => 'Edit virtual machine',
-                                       'permission_vm_delete' => 'Delete virtual machine',
-                                       'permission_network_create' => 'Create virtual network',
-                                       'permission_network_edit' => 'Edit virtual network',
-                                       'permission_network_delete' => 'Delete virtual network',
-                                       'permission_user_create' => 'Create user',
-                                       'permission_user_edit' => 'Edit user',
-                                       'permission_user_delete' => 'Delete user',
-                                       'user_add_btn' => 'Add user',
-                                       'user_edit_btn' => 'Edit user',
-                                       'password_mismatch' => 'Password mismatch',
+                                       'permission-basic' => 'Basic access',
+                                       'permission-save-connection' => 'Save connection',
+                                       'permission-vm-create' => 'Create virtual machine',
+                                       'permission-vm-edit' => 'Edit virtual machine',
+                                       'permission-vm-delete' => 'Delete virtual machine',
+                                       'permission-network-create' => 'Create virtual network',
+                                       'permission-network-edit' => 'Edit virtual network',
+                                       'permission-network-delete' => 'Delete virtual network',
+                                       'permission-user-create' => 'Create user',
+                                       'permission-user-edit' => 'Edit user',
+                                       'permission-user-delete' => 'Delete user',
+                                       'user-add-btn' => 'Add user',
+                                       'user-edit-btn' => 'Edit user',
+                                       'password-mismatch' => 'Password mismatch',
                                        'screenshot-settings-auto-release' => 'Send automatic mouse pointer release event',
                                        'screenshot-delay' => 'Delay has been changed to %d second(s)',
-                                       'cpu_stats' => 'Node CPU stats',
-                                       'mem_stats' => 'Node memory stats',
-                                       'system_information' => 'System information',
+                                       'cpu-stats' => 'Node CPU stats',
+                                       'mem-stats' => 'Node memory stats',
+                                       'system-information' => 'System information',
                                        'date-format' => 'Y-m-d H:i:s',
                                        'run' => 'Run',
                                        'no-destination-present' => 'No destination present or connected',
                                        'choose-destination' => 'Choose migration destination',
-                                       'dom_migrate' => 'Migrate domain',
-                                       'cpu_stats_per_each_cpu' => 'Node CPU stats per each CPU (one second average)',
+                                       'dom-migrate' => 'Migrate domain',
+                                       'cpu-stats-per-each-cpu' => 'Node CPU stats per each CPU (one second average)',
+                                       'net-none' => 'No network available on the connection',
+                                       'disk-removed' => 'Disk has been removed successfully',
+                                       'disk-not-remove' => 'Disk cannot be removed',
+                                       'disk-added' => 'Disk has been successfully added to the guest',
+                                       'disk-not-added' => 'Cannot add disk to the guest',
+                                       'boot-order-changed' => 'Boot options for next run have been altered successfully',
+                                       'boot-order-change-error' => 'Cannot change guest boot options',
+
+                                       'mem-alloc-changed' => 'Memory allocation for next run has been altered successfully',
+                                       'mem-alloc-change-error' => 'Cannot change memory allocation',
                                        );
 
                        $this->trans = $trans;
diff --git a/classes/libvirt-domain.php b/classes/libvirt-domain.php
new file mode 100644 (file)
index 0000000..1ac0724
--- /dev/null
@@ -0,0 +1,246 @@
+<?php
+       class LibvirtDomain extends LoggerBase {
+               private $data = false;
+               private $lang = false;
+               private $lv = false;
+
+               function LibvirtDomain($libvirtInstance, $languageInstance, $action = false, $input = array()) {
+                       $this->lv = $libvirtInstance;
+                       $this->lang = $languageInstance;
+
+                       if ($action)
+                               $this->_processAction($action, $input);
+               }
+
+               function getData() {
+                       return $this->data;
+               }
+
+               function _processAction($action, $input = array()) {
+                       if (!$action)
+                               return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'No action defined', 'Cannot process empty action');
+
+                       $msg = false;
+                       $frm = false;
+                       $xml = false;
+
+                       $lv = $this->lv;
+                       $lang = $this->lang;
+
+                       if ($action == 'domain-start') {
+                               if (!array_key_exists('dom', $input))
+                                       return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'Domain start failed', 'Domain name not present');
+
+                               $name = $input['dom'];
+                               $msg = $lv->domain_start($name) ? $lang->get('dom-start-ok') :
+                                       $lang->get('dom-start-err').': '.$lv->get_last_error();
+                       }
+
+                       if ($action == 'domain-stop') {
+                               if (!array_key_exists('dom', $input))
+                                       return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'Domain shutdown failed', 'Domain name not present');
+
+                               $name = $input['dom'];
+                               $msg = $lv->domain_shutdown($name) ? $lang->get('dom-shutdown-ok') :
+                                       $lang->get('dom-shutdown-err').': '.$lv->get_last_error();
+                       }
+
+                       if ($action == 'domain-destroy') {
+                               if (!array_key_exists('dom', $input))
+                                       return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'Domain destroy failed', 'Domain name not present');
+
+                               $name = $input['dom'];
+                               $msg = $lv->domain_destroy($name) ? $lang->get('dom-destroy-ok') :
+                                       $lang->get('dom-destroy-err').': '.$lv->get_last_error();
+                       }
+
+                       if (($action == 'domain-undefine') && (verify_user($db, USER_PERMISSION_VM_DELETE))) {
+                               if (!array_key_exists('dom', $input))
+                                       return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'Domain undefine failed', 'Domain name not present');
+
+                               $name = $input['dom'];
+                               if ((!array_key_exists('confirmed', $_GET)) || ($_GET['confirmed'] != 1)) {
+                                       $frm = '<div class="section">'.$lang->get('dom-undefine').'</div>
+                                               <table id="form-table">
+                                               <tr>
+                                                 <td colspan="3">'.$lang->get('dom-undefine-question').' '.$lang->get('name').': <u>'.$name.'</u></td>
+                                               </tr>
+                                               <tr align="center">
+                                                 <td><a href="'.$_SERVER['REQUEST_URI'].'&amp;confirmed=1">'.$lang->get('delete').'</a></td>
+                                                 <td><a href="'.$_SERVER['REQUEST_URI'].'&amp;confirmed=1&amp;deldisks=1">'.$lang->get('delete-with-disks').'</a></td>
+                                                 <td><a href="?page='.$page.'">'.$lang->get('No').'</a></td>
+                                               </td>
+                                               </table>';
+                               }
+                               else {
+                                       $err = '';
+                                       if (array_key_exists('deldisks', $_GET) && $_GET['deldisks'] == 1) {
+                                               $disks = $lv->get_disk_stats($name);
+
+                                               for ($i = 0; $i < sizeof($disks); $i++) {
+                                                       $img = $disks[$i]['file'];
+
+                                                       if (!$lv->remove_image($img, array(2) ))
+                                                               $err .= $img.': '.$lv->get_last_error();
+                                               }
+                                       }
+
+                                       $msg = $lv->domain_undefine($name) ? $lang->get('dom-undefine-ok') :
+                                               $lang->get('dom-undefine-err').': '.$lv->get_last_error();
+
+                                       if ($err)
+                                               $msg .= ' (err: '.$err.')';
+                               }
+                       }
+
+                       if ($action == 'domain-dump') {
+                               if (!array_key_exists('dom', $input))
+                                       return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'Domain dump failed', 'Domain name not present');
+
+                               $name = $input['dom'];
+                               $inactive = (!$lv->domain_is_running($name)) ? true : false;
+
+                               $xml = $lv->domain_get_xml($name, $inactive);
+                               $frm = '<div class="section">'.$lang->get('dom-xmldesc').' - <i>'.$name.'</i></div><form method="POST">
+                                       <table id="form-table"><tr><td>'.$lang->get('dom-xmldesc').': </td>
+                                       <td><textarea readonly="readonly" name="xmldesc" rows="25" cols="90%">'.$xml.'</textarea></td></tr><tr align="center"><td colspan="2">
+                                       </tr></form></table>';
+                       }
+
+                       if ($action == 'domain-migrate') {
+                               if (!array_key_exists('dom', $input))
+                                       return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'Domain migration failed', 'Domain name not present');
+
+                               $name = $input['dom'];
+                               if (!array_key_exists('dest-uri', $_POST)) {
+                                       $uris = array();
+
+                                       if (isset($conns) && $conns) {
+                                               foreach ($conns as $conn) {
+                                                       if ($conn['connection_uri'] != $uri)
+                                                               $uris[] = array(
+                                                                       'id' => $conn['id'],
+                                                                       'name' => $conn['connection_name']
+                                                                       );
+                                               }
+                                       }
+                                       else
+                                               $uris = array();
+
+                                       if (sizeof($uris) == 0)
+                                               echo $lang->get('no-destination-present');
+                                       else {
+                                               echo "<form method='POST'>".$lang->get('choose-destination')." ($name): <br /><select name='dest-uri' style='width: 150px'>";
+
+                                               foreach ($uris as $cn)
+                                                       echo "<option value=\"${cn['id']}\">{$cn['name']}</option>";
+
+                                               echo "</select><br /><input type='submit' value='".$lang->get('dom-migrate')."'>";
+                                       }
+                               }
+                               else {
+                                       $arr = false;
+
+                                       for ($i = 0; $i < sizeof($conns); $i++) {
+                                               if ($conns[$i]['id'] == $_POST['dest-uri']) {
+                                                       $arr = $conns[$i];
+                                                       break;
+                                               }
+                                       }
+
+                                       if ($arr && (!$lv->migrate($name, $arr)))
+                                               echo '<b>'.$lang->get('error-page-title').'</b>: '.$lv->get_last_error();
+                               }
+                       }
+
+                       if ($action == 'domain-edit') {
+                               if (!array_key_exists('dom', $input))
+                                       return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'Domain editing failed', 'Domain name not present');
+
+                               $name = $input['dom'];
+                               $inactive = (!$lv->domain_is_running($name)) ? true : false;
+
+                               if (array_key_exists('xmldesc', $_POST)) {
+                                       $msg = $lv->domain_change_xml($name, $_POST['xmldesc']) ? $lang->get('dom-define-changed') :
+                                               $lang->get('dom-define-change-err').': '.$lv->get_last_error();
+                               }
+                               else {
+                                       $xml = $lv->domain_get_xml($name, $inactive);
+                                       $frm = '<div class="section">'.$lang->get('dom-editxml').' - <i>'.$name.'</i></div><form method="POST"><table id="form-table"><tr><td>'.$lang->get('dom-xmldesc').': </td>
+                                               <td><textarea name="xmldesc" rows="25" cols="90%">'.$xml.'</textarea></td></tr><tr align="center"><td colspan="2">
+                                               <input type="submit" value=" '.$lang->get('dom-editxml').' "></tr></form></table>';
+                               }
+                       }
+
+                       $this->data = array(
+                                       'msg' => $msg,
+                                       'frm' => $frm,
+                                       'xml' => $xml
+                                       );
+               }
+
+               function createNewVM($input) {
+                       $lv = $this->lv;
+                       $lang = $this->lang;
+
+                       $skip = false;
+                       $msg = false;
+                       if (array_key_exists('sent', $input)) {
+                               $features = array('apic', 'acpi', 'pae', 'hap');
+                               $iso_path = ini_get('libvirt.iso_path');
+                               $img = $iso_path.'/'.$input['install_img'];
+
+                               $feature = array();
+                               for ($i = 0; $i < sizeof($features); $i++)
+                                       if (array_key_exists('feature_'.$features[$i], $input))
+                                               $feature[] = $features[$i];
+
+                               $nic = array();
+                               if ($input['setup_nic']) {
+                                       $nic['mac'] = $input['nic_mac'];
+                                       $nic['type'] = $input['nic_type'];
+                                       $nic['network'] = $input['nic_net'];
+                               }
+                               $disk = array();
+                               if ($input['setup_disk']) {
+                                       if ($input['new_vm_disk']) {
+                                               $disk['image'] = $input['name'].'.'.$input['disk_driver'];
+                                               $disk['size'] = (int)$input['img_data'];
+                                               $disk['bus'] = $input['disk_bus'];
+                                               $disk['driver'] = $input['disk_driver'];
+                                       }
+                                       else {
+                                               $disk['image'] = $input['img_data'];
+                                               $disk['size'] = 0;
+                                               $disk['bus'] = $input['disk_bus'];
+                                               $disk['driver'] = $input['disk_driver'];
+                                       }
+                               }
+
+                               $tmp = $lv->domain_new($input['name'], $img, $input['cpu_count'], $feature, $input['memory'], $input['maxmem'], $input['clock_offset'], $nic, $disk, $input['setup_persistent']);
+                               if (!$tmp)
+                                       $msg = $lv->get_last_error();
+                               else {
+                                       $skip = true;
+                                       $msg = $lang->get('new-vm-created');
+                               }
+                       }
+
+                       $isos = libvirt_get_iso_images();
+
+                       if (empty($isos))
+                               $msg = $lang->get('no-iso');
+
+                       $ci  = $lv->get_connect_information();
+                       $maxvcpu = $ci['hypervisor_maxvcpus'];
+                       unset($ci);
+
+                       return array(
+                                               'skip' => $skip,
+                                               'msg' => $msg,
+                                               'isos' => $isos,
+                                               'maxvcpu' => $maxvcpu
+                                       );
+               }
+       }
+?>
diff --git a/classes/libvirt-info.php b/classes/libvirt-info.php
new file mode 100644 (file)
index 0000000..22cfa3e
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+       class LibvirtInfo extends LoggerBase {
+               private $lv = false;
+
+               function LibvirtInfo($libvirtInstance) {
+                       $this->lv = $libvirtInstance;
+               }
+
+               function getModuleInfo() {
+                       ob_start();
+                       PHPInfo();
+                       $c = ob_get_contents();
+                       ob_end_clean();
+
+                       $c = substr($c, strpos($c, 'module_libvirt'));
+                       $c = substr($c, strpos($c, 'h2') + 3);
+
+                       $p = strpos($c, 'module') - 3;
+                       $out = substr($c, 0, $p);
+
+                       $out = str_replace('<tr>', '<div class="item">', $out);
+                       $out = str_replace('<td class="e">', '<div class="label">', $out);
+                       $out = str_replace('</td><td class="v">', '</div><div class="value">', $out);
+                       $out = str_replace('</td></tr>', '</div><div class="nl" /></div>', $out);
+
+                       $tmp = explode("\n", $out);
+                       $start_el = false;
+                       $last_el = false;
+                       for ($i = 0; $i < sizeof($tmp); $i++) {
+                               if (strpos('.'.$tmp[$i], '</table'))
+                                       $last_el = $i;
+                               if (strpos('.'.$tmp[$i], '<table'))
+                                       $start_el = $i + 1;
+                       }
+
+                       $tmp2 = array();
+                       for ($i = $start_el; $i < $last_el; $i++)
+                               $tmp2[] = $tmp[$i];
+                       unset($tmp);
+
+                       return join("\n", $tmp2);
+               }
+
+               function getConnectInfo() {
+                       return $this->lv->get_connect_information();
+               }
+
+               function getNodeInfo() {
+                       return $this->lv->host_get_node_info();
+               }
+
+               function getCpuStats() {
+                       return $this->lv->node_get_cpu_stats();
+               }
+
+               function getCpuStatsEachCPU() {
+                       return $this->lv->node_get_cpu_stats_each_cpu(2);
+               }
+
+               function getMemoryStats() {
+                       return $this->lv->node_get_mem_stats();
+               }
+
+               function getSystemInfo() {
+                       return $this->lv->connect_get_sysinfo();
+               }
+       }
+?>
diff --git a/classes/libvirt-network.php b/classes/libvirt-network.php
new file mode 100644 (file)
index 0000000..3766d93
--- /dev/null
@@ -0,0 +1,143 @@
+<?php
+       class LibvirtNetwork extends LoggerBase {
+               private $data = false;
+               private $lang = false;
+               private $lv = false;
+
+               function LibvirtNetwork($libvirtInstance, $languageInstance, $action = false, $input = array()) {
+                       $this->lv = $libvirtInstance;
+                       $this->lang = $languageInstance;
+
+                       if ($action)
+                               $this->_processAction($action, $input);
+               }
+
+               function getData() {
+                       return $this->data;
+               }
+
+               function _processAction($action, $input = array()) {
+                       if (!$action)
+                               return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'No action defined', 'Cannot process empty action');
+
+                       $msg = false;
+                       $frm = false;
+                       $xml = false;
+
+                       $lv = $this->lv;
+                       $lang = $this->lang;
+
+                       if ($action == 'net-start') {
+                               if (!array_key_exists('net', $input))
+                                       return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'Network start failed', 'Network name not present');
+
+                               $name = $input['net'];
+
+                               $msg = $lv->set_network_active($name, true) ? $lang->get('net-start-ok') :
+                                       $lang->get('net-start-err').': '.$lv->get_last_error();
+                       }
+                       else
+                       if ($action == 'net-stop') {
+                               if (!array_key_exists('net', $input))
+                                       return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'Network stop failed', 'Network name not present');
+
+                               $name = $input['net'];
+                               $msg = $lv->set_network_active($name, false) ? $lang->get('net-stop-ok') :
+                                       $lang->get('net-stop-err').': '.$lv->get_last_error();
+                       }
+                       else
+                       if (($action == 'net-undefine') && (verify_user($db, USER_PERMISSION_NETWORK_CREATE))){
+                               if (!array_key_exists('net', $input))
+                                       return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'Network undefine failed', 'Network name not present');
+
+                               $name = $input['net'];
+                               if ((!array_key_exists('confirmed', $_GET)) || ($_GET['confirmed'] != 1)) {
+                                       $frm = '<div class="section">'.$lang->get('net-undefine').'</div>
+                                               <table id="form-table">
+                                               <tr>
+                                                       <td colspan="3">'.$lang->get('net-undefine-question').' '.$lang->get('name').': <u>'.$name.'</u></td>
+                                               </tr>
+                                               <tr align="center">
+                                                       <td><a href="'.$_SERVER['REQUEST_URI'].'&amp;confirmed=1">'.$lang->get('Yes').'</a></td>
+                                                       <td><a href="?page='.$page.'">'.$lang->get('No').'</a></td>
+                                               </tr>
+                                               </table>';
+                               }
+                               else {
+                                       $msg = $lv->network_undefine($name) ? $lang->get('net-undefine-ok') :
+                                               $lang->get('net-undefine-err').': '.$lv->get_last_error();
+                               }
+                       }
+                       else
+                       if ($action == 'net-dumpxml') {
+                               if (!array_key_exists('net', $input))
+                                       return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'Network undefine failed', 'Network name not present');
+
+                               $name = $input['net'];
+
+                               $xml = $lv->network_get_xml($name);
+                               $frm = '<div class="section">'.$lang->get('net-xmldesc').' - <i>'.$name.'</i></div><form method="POST">
+                                       <table id="form-table"><tr><td>'.$lang->get('net-xmldesc').': </td>
+                                       <td><textarea readonly="readonly" name="xmldesc" rows="25" cols="90%">'.$xml.'</textarea></td></tr><tr align="center"><td colspan="2">
+                                       </tr></form></table>';
+                       }
+                       else
+                       if (($action == 'net-editxml') && (verify_user($db, USER_PERMISSION_NETWORK_EDIT))) {
+                               if (!array_key_exists('net', $input))
+                                       return $this->log(TYPE_ERROR, __CLASS__.'::'.__FUNCTION__, 'Network undefine failed', 'Network name not present');
+
+                               $name = $input['net'];
+
+                               if (array_key_exists('xmldesc', $_POST)) {
+                               $msg = $lv->network_change_xml($name, $_POST['xmldesc']) ? $lang->get('net-define-changed') :
+                                       $lang->get('net-define-change-err').': '.$lv->get_last_error();
+                               }
+                               else {
+                                       $xml = $lv->network_get_xml($name);
+                                       $frm = '<div class="section">'.$lang->get('net-editxml').' - <i>'.$name.'</i></div><form method="POST"><table id="form-table"><tr><td>'.
+                                               $lang->get('net-xmldesc').': </td><td><textarea name="xmldesc" rows="25" cols="90%">'.$xml.'</textarea></td></tr><tr align="center"><td colspan="2">
+                                               <input type="submit" value=" '.$lang->get('net-editxml').' "></tr></form></table>';
+
+                               }
+                       }
+
+                       $this->data = array(
+                                       'msg' => $msg,
+                                       'frm' => $frm,
+                                       'xml' => $xml
+                                       );
+
+               }
+
+               function createNewNetwork($input) {
+                       $lv = $this->lv;
+                       $lang = $this->lang;
+
+                       $skip = false;
+                       $msg = false;
+
+                       if (array_key_exists('sent', $input)) {
+                               if ($input['ip_range_cidr'])
+                                       $ipinfo = $input['net_cidr'];
+                               else
+                                       $ipinfo = array('ip' => $input['net_ip'], 'netmask' => $input['net_mask']);
+
+                               $dhcpinfo = ($input['setup_dhcp']) ? $input['net_dhcp_start'].'-'.$input['net_dhcp_end'] : false;
+
+                               $tmp = $lv->network_new($input['name'], $ipinfo, $dhcpinfo, $input['forward'], $input['net_forward_dev']);
+                               if (!$tmp)
+                                       $msg = $lv->get_last_error();
+                               else {
+                                       $skip = true;
+                                       $msg = $lang->get('net-created');
+                               }
+                               unset($tmp);
+                       }
+
+                       return array(
+                                       'skip' => $skip,
+                                       'msg' => $msg
+                                       );
+               }
+       }
+?>
index 057941f..ad8335d 100644 (file)
                        $lang = new Language($this->lang_str);
                        $ret = $lang->get('unknown');
                        switch ($state) {
-                               case 0: $ret = $lang->get('pool_not_running');
+                               case 0: $ret = $lang->get('pool-not-running');
                                        break;
-                               case 1: $ret = $lang->get('pool_building');
+                               case 1: $ret = $lang->get('pool-building');
                                        break;
-                               case 2: $ret = $lang->get('pool_running');
+                               case 2: $ret = $lang->get('pool-running');
                                        break;
-                               case 3: $ret = $lang->get('pool_running_deg');
+                               case 3: $ret = $lang->get('pool-running-deg');
                                        break;
-                               case 4: $ret = $lang->get('pool_running_inac');
+                               case 4: $ret = $lang->get('pool-running-inac');
                                        break;
                        }
                        unset($lang);
                }
 
                function domain_get_name($res) {
+                       if (!is_resource($res))
+                               return false;
+
                        return libvirt_domain_get_name($res);
                }
 
 
                        $domname = $name_override ? $name_override : $name;
                        $domkey  = $name_override ? $name_override : $this->domain_get_name($name);
+
+                       if ((!$domkey) && (is_string($name))) {
+                               $dom = $this->get_domain_object($name);
+                               if (!$dom)
+                                       return false;
+                               return libvirt_domain_get_info($dom);
+                       }
+
                        if (!array_key_exists($domkey, $this->dominfos)) {
                                $tmp = $this->domain_get_info_call($name, $name_override);
                                $this->dominfos[$domkey] = $tmp[$domname];
 
                        $ret = $lang->get('unknown');
                        switch ($state) {
-                               case VIR_DOMAIN_RUNNING:  $ret = $lang->get('dom_running');
+                               case VIR_DOMAIN_RUNNING:  $ret = $lang->get('dom-running');
                                                          break;
-                               case VIR_DOMAIN_NOSTATE:  $ret = $lang->get('dom_nostate');
+                               case VIR_DOMAIN_NOSTATE:  $ret = $lang->get('dom-nostate');
                                                          break;
-                               case VIR_DOMAIN_BLOCKED:  $ret = $lang->get('dom_blocked');
+                               case VIR_DOMAIN_BLOCKED:  $ret = $lang->get('dom-blocked');
                                                          break;
-                               case VIR_DOMAIN_PAUSED:   $ret = $lang->get('dom_paused');
+                               case VIR_DOMAIN_PAUSED:   $ret = $lang->get('dom-paused');
                                                          break;
-                               case VIR_DOMAIN_SHUTDOWN: $ret = $lang->get('dom_shutdown');
+                               case VIR_DOMAIN_SHUTDOWN: $ret = $lang->get('dom-shutdown');
                                                          break;
-                               case VIR_DOMAIN_SHUTOFF:  $ret = $lang->get('dom_shutoff');
+                               case VIR_DOMAIN_SHUTOFF:  $ret = $lang->get('dom-shutoff');
                                                          break;
-                               case VIR_DOMAIN_CRASHED:  $ret = $this->get('dom_crashed');
+                               case VIR_DOMAIN_CRASHED:  $ret = $lang->get('dom-crashed');
                                                          break;
                        }
                        unset($lang);
diff --git a/classes/loggerBase.php b/classes/loggerBase.php
new file mode 100644 (file)
index 0000000..e906016
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+       /**
+       * Basic logger class for common usage purposes
+       */
+
+        define('TYPE_INFO', 1);
+        define('TYPE_WARN', 2);
+        define('TYPE_ERROR', 3);
+        define('TYPE_FATAL', 4);
+
+       class LoggerBase {
+               private $log = array();
+
+               function log($type, $lib, $msg, $data='') {
+                       if (!$this->debug) return;
+                       $this->log[ sizeof($this->log) ] = array(
+                               'type' => $type,
+                               'lib'  => $lib,
+                               'msg'  => $msg,
+                               'data' => $data
+                       );
+               }
+
+               function log_overwrite($log_obj) {
+                       if (!$this->debug) return;
+
+                       $this->log = $log_obj;
+               }
+
+               function get_log() {
+                       return $this->log;
+               }
+       }
+?>
index 1d33323..40a9edf 100644 (file)
@@ -1,7 +1,7 @@
 
 <html> 
 <head> 
- <title>php-virt-control - <?php echo $lang->get('title_vmc') ?></title> 
+ <title>php-virt-control - <?php echo $lang->get('title-vmc') ?></title
  <link rel="STYLESHEET" type="text/css" href="manager.css"> 
 </head> 
 <body> 
 
 <?php
        if (array_key_exists('user', $_POST))
-               echo '<div id="msg"><b>Message: </b>'.$lang->get('login_invalid').'</div>';
+               echo '<div id="msg"><b>Message: </b>'.$lang->get('login-invalid').'</div>';
 ?>
 
     <form method="POST">
 
-    <div class="section"><?php echo $lang->get('login_page_title') ?></div>
+    <div class="section"><?php echo $lang->get('login-page-title') ?></div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('login_enter_login') ?></div>
+      <div class="label"><?php echo $lang->get('login-enter-login') ?></div>
       <div class="value"><input type="text" name="user"></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('login_enter_password') ?></div>
+      <div class="label"><?php echo $lang->get('login-enter-password') ?></div>
       <div class="value"><input type="password" name="password"></div>
       <div class="nl" />
     </div>
     <div class="item">
       <div class="label">&nbsp;</div>
-      <div class="value"><input type="submit" value="<?php echo $lang->get('login_submit') ?>"></div>
+      <div class="value"><input type="submit" value="<?php echo $lang->get('login-submit') ?>"></div>
       <div class="nl" />
     </div>
  
index e89b474..d590599 100644 (file)
@@ -1,7 +1,7 @@
 
 <html> 
 <head> 
- <title>php-virt-control - <?php echo $lang->get('title_vmc') ?></title> 
+ <title>php-virt-control - <?php echo $lang->get('title-vmc') ?></title>
  <link rel="STYLESHEET" type="text/css" href="manager.css"> 
 </head> 
 <body> 
   <!-- CONTENTS --> 
   <div id="content"> 
 
-    <div class="section"><?php echo $lang->get('error_page_title') ?></div>
+    <div class="section"><?php echo $lang->get('error-page-title') ?></div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('error_connection_db_label') ?></div>
-      <div class="value"><?php echo $lang->get('error_connection_db_text').' '.$lang->get($db->get_fatal_error()) ?></div>
+      <div class="label"><?php echo $lang->get('error-connection-db-label') ?></div>
+      <div class="value"><?php echo $lang->get('error-connection-db-text').' '.$lang->get($db->get_fatal_error()) ?></div>
       <div class="nl" />
     </div>
  
index 63e017f..2d840d9 100644 (file)
@@ -1,7 +1,7 @@
 
 <html> 
 <head> 
- <title>php-virt-control - <?php echo $lang->get('title_vmc') ?></title> 
+ <title>php-virt-control - <?php echo $lang->get('title-vmc') ?></title>
  <link rel="STYLESHEET" type="text/css" href="manager.css"> 
 </head> 
 <body> 
   <!-- CONTENTS --> 
   <div id="content"> 
 
-    <div class="section"><?php echo $lang->get('error_page_title') ?></div>
+    <div class="section"><?php echo $lang->get('error-page-title') ?></div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('error_missing_label') ?></div>
-      <div class="value"><?php echo $lang->get('error_missing_text') ?></div>
+      <div class="label"><?php echo $lang->get('error-missing-label') ?></div>
+      <div class="value"><?php echo $lang->get('error-missing-text') ?></div>
       <div class="nl" />
     </div>
  
index f827128..37fbcf0 100644 (file)
@@ -1,7 +1,7 @@
 
 <html> 
 <head> 
- <title>php-virt-control - <?php echo $lang->get('title_vmc') ?></title> 
+ <title>php-virt-control - <?php echo $lang->get('title-vmc') ?></title>
  <link rel="STYLESHEET" type="text/css" href="manager.css"> 
 </head> 
 <body> 
   <!-- CONTENTS --> 
   <div id="content"> 
 
-    <div class="section"><?php echo $lang->get('error_page_title') ?></div>
+    <div class="section"><?php echo $lang->get('error-page-title') ?></div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('error_need_update_label') ?></div>
-      <div class="value"><?php echo $lang->get('error_need_update_text') ?></div>
+      <div class="label"><?php echo $lang->get('error-need-update-label') ?></div>
+      <div class="value"><?php echo $lang->get('error-need-update-text') ?></div>
       <div class="nl" />
     </div>
  
index 9309044..a527e79 100644 (file)
--- a/error.php
+++ b/error.php
@@ -1,10 +1,10 @@
   <!-- CONTENTS -->
   <div id="content">
 
-    <div class="section"><?php echo $lang->get('error_page_title') ?></div>
+    <div class="section"><?php echo $lang->get('error-page-title') ?></div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('error_page_label') ?></div>
-      <div class="value"><?php echo $lang->get('error_page_text') ?></div>
+      <div class="label"><?php echo $lang->get('error-page-label') ?></div>
+      <div class="value"><?php echo $lang->get('error-page-text') ?></div>
       <div class="nl" />
     </div>
 
index 201e3d2..d6573f8 100644 (file)
 
                return $logged_in;
         }
+
+       function get_languages()
+       {
+               $dh = opendir('lang');
+
+               if (!$dh)
+                       return false;
+
+               $langs = array();
+               while (($file = readdir($dh)) !== false) {
+                       if (strpos($file, '.php')) {
+                               include('lang/'.$file);
+
+                               $langs[] = array(
+                                               'name' => $lang_name,
+                                               'code' => $lang_code
+                                               );
+                       }
+               }
+               closedir($dh);
+
+               return $langs;
+       }
 ?>
index b0431fc..86d45d3 100644 (file)
--- a/index.php
+++ b/index.php
        if (!$lv->enabled() || ($lv->get_last_error())) {
                $page = 'overview';
                $name = false;
-               $errmsg = $lang->get('cannot_connect').' '.$lv->get_last_error();
+               $errmsg = $lang->get('cannot-connect').' '.$lv->get_last_error();
        }
        else {
                $name = array_key_exists('name', $_GET) ? $_GET['name'] : false;
 ?>
 <html>
 <head>
- <title>php-virt-control - <?php echo $lang->get('title_vmc') ?></title>
+ <title>php-virt-control - <?php echo $lang->get('title-vmc') ?></title>
  <link rel="STYLESHEET" type="text/css" href="html/main.css" />
  <link rel="STYLESHEET" type="text/css" href="manager.css" />
 </head>
        include('main-menu.php');
        if ($name):
 ?>
-       <h2 id="vm-name"><?php echo $lang->get('vm_title').' '.$name ?></h2>
+       <h2 id="vm-name"><?php echo $lang->get('vm-title').' '.$name ?></h2>
 <?php
        include('menu.php');
        if (File_Exists('./pages/details/'.$page.'.php'))
index ba17ee6..626be17 100644 (file)
--- a/init.php
+++ b/init.php
@@ -2,7 +2,7 @@
        define('DEBUG', false);
        define('LOGDIR', getcwd().'/logs');
        define('LIBVIRT_PHP_REQ_VERSION', '0.4.4');
-       define('PHPVIRTCONTROL_VERSION', '0.0.3');
+       define('PHPVIRTCONTROL_VERSION', '0.0.5');
        define('PHPVIRTCONTROL_WEBSITE', 'http://www.php-virt-control.org');
        define('CONNECT_WITH_NULL_STRING', false);
        define('ALLOW_EXPERIMENTAL_VNC', true);
        define('USER_PERMISSION_USER_DELETE', 0x400);
 
        $user_permissions = array(
-                               'USER_PERMISSION_BASIC'                 => 'permission_basic',
-                               'USER_PERMISSION_SAVE_CONNECTION'       => 'permission_save_connection',
-                               'USER_PERMISSION_VM_CREATE'             => 'permission_vm_create',
-                               'USER_PERMISSION_VM_EDIT'               => 'permission_vm_edit',
-                               'USER_PERMISSION_VM_DELETE'             => 'permission_vm_delete',
-                               'USER_PERMISSION_NETWORK_CREATE'        => 'permission_network_create',
-                               'USER_PERMISSION_NETWORK_EDIT'          => 'permission_network_edit',
-                               'USER_PERMISSION_NETWORK_DELETE'        => 'permission_network_delete',
-                               'USER_PERMISSION_USER_CREATE'           => 'permission_user_create',
-                               'USER_PERMISSION_USER_EDIT'             => 'permission_user_edit',
-                               'USER_PERMISSION_USER_DELETE'           => 'permission_user_delete',
+                               'USER_PERMISSION_BASIC'                 => 'permission-basic',
+                               'USER_PERMISSION_SAVE_CONNECTION'       => 'permission-save-connection',
+                               'USER_PERMISSION_VM_CREATE'             => 'permission-vm-create',
+                               'USER_PERMISSION_VM_EDIT'               => 'permission-vm-edit',
+                               'USER_PERMISSION_VM_DELETE'             => 'permission-vm-delete',
+                               'USER_PERMISSION_NETWORK_CREATE'        => 'permission-network-create',
+                               'USER_PERMISSION_NETWORK_EDIT'          => 'permission-network-edit',
+                               'USER_PERMISSION_NETWORK_DELETE'        => 'permission-network-delete',
+                               'USER_PERMISSION_USER_CREATE'           => 'permission-user-create',
+                               'USER_PERMISSION_USER_EDIT'             => 'permission-user-edit',
+                               'USER_PERMISSION_USER_DELETE'           => 'permission-user-delete',
                                );
 
        session_start();
 
        require('functions.php');
        require('classes/libvirt.php');
+       require('classes/loggerBase.php');
+       require('classes/libvirt-domain.php');
+       require('classes/libvirt-network.php');
+       require('classes/libvirt-info.php');
        require('classes/graphics.php');
        require('classes/language.php');
        require('classes/database.php');
@@ -85,8 +89,8 @@
        /* If connection.php in config dir doesn't exist override to local config dir */
        if (!include('/etc/php-virt-control/connection.php'))
                $cstr = 'mysql:config/mysql-connection.php';
-
-       else $cstr = $type.':/etc/php-virt-control/'.$config;
+       else
+               $cstr = $type.':/etc/php-virt-control/'.$config;
 
        $db = getDBObject($cstr);
        $db->init();
index 7ccd82d..aba6dcc 100644 (file)
@@ -2,24 +2,24 @@
                $lang_name = 'Čeština (Czech)';
                $lang_code = 'cs';
                $trans = array(
-                                       'title_vmc' => 'Ovládací panel virtuálních strojů',
-                                       'for_php' => 'pro PHP',
+                                       'title-vmc' => 'Ovládací panel virtuálních strojů',
+                                       'for-php' => 'pro PHP',
                                        'version' => 'Verze',
                                        'website' => 'Stránka projektu',
-                                       'conn_details' => 'Detaily připojení',
-                                       'conn_uri' => 'URI připojení',
-                                       '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',
+                                       'conn-details' => 'Detaily připojení',
+                                       'conn-uri' => 'URI připojení',
+                                       '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',
                                        'Yes' => 'Ano',
                                        'No' => 'Ne',
-                                       'error_page_title' => 'Chyba',
-                                       'error_connection_db_label' => 'Chyba databáze',
-                                       'error_connection_db_text' => 'Připojení k Vaší databázi se nezdařilo.',
+                                       'error-page-title' => 'Chyba',
+                                       'error-connection-db-label' => 'Chyba databáze',
+                                       'error-connection-db-text' => 'Připojení k Vaší databázi se nezdařilo.',
                                        'no-datafile' => 'Datový soubor neexistuje.',
                                        'no-server' => 'Definice serveru v datovém souboru neexistuje.',
                                        'no-user' => 'Definice uživatele v datovém souboru neexistuje.',
                                        'no-dbname' => 'Definice jména databáze v datovém souboru neexistuje.',
                                        'db-failure-connect' => 'Nezdařilo se připojit k databázi. Prosím zkontrolujte konfiguraci.',
                                        'db-failure-select' => 'Nezdařilo se přepnout databázi. Prosím zkontrolujte konfiguraci.',
-                                       'error_page_label' => 'Stránka nenalezena:',
-                                       'error_page_text' => 'Stránka, kterou hledáte, nebyla nalezena. Prosím reportujte tuto chybu správci a zkuste znovu později.',
-                                       'error_missing_label' => 'Chybějící závislost:',
-                                       'error_missing_text' => 'Vaší konfigurace PHP chybí modul libvirt-php, která je nezbytný pro správu virtuálních strojů. Prosím nainstalujte prvně libvirt-php z <a href="http://libvirt.org/php">http://libvirt.php</a>.',
-                                       'error_need_update_label' => 'Nutná aktualizace:',
-                                       'error_need_update_text' => 'Vaše verze modulu libvirt-php je příliš zastaralá pro potřeby této aplikace. Prosím aktualizujte prvně verzi libvirt-php na aktuální verzi ze stránky <a href="http://libvirt.org/php">http://libvirt.php</a>.',
-                                       'host_details' => 'Detaily hostitele',
+                                       'error-page-label' => 'Stránka nenalezena:',
+                                       'error-page-text' => 'Stránka, kterou hledáte, nebyla nalezena. Prosím reportujte tuto chybu správci a zkuste znovu později.',
+                                       'error-missing-label' => 'Chybějící závislost:',
+                                       'error-missing-text' => 'Vaší konfigurace PHP chybí modul libvirt-php, která je nezbytný pro správu virtuálních strojů. Prosím nainstalujte prvně libvirt-php z <a href="http://libvirt.org/php">http://libvirt.php</a>.',
+                                       'error-need-update-label' => 'Nutná aktualizace:',
+                                       'error-need-update-text' => 'Vaše verze modulu libvirt-php je příliš zastaralá pro potřeby této aplikace. Prosím aktualizujte prvně verzi libvirt-php na aktuální verzi ze stránky <a href="http://libvirt.org/php">http://libvirt.php</a>.',
+                                       'host-details' => 'Detaily hostitele',
                                        'model' => 'Model',
                                        'pcpus' => 'Procesory/jádra',
-                                       'cpu_speed' => 'Rychlost CPU',
+                                       'cpu-speed' => 'Rychlost CPU',
                                        'modinfo' => 'Informace o PHP modulu (anglicky z PHPInfo)',
-                                       'pool_not_running' => 'Neaktivní',
-                                       'pool_building' => 'Staví se',
-                                       'pool_running' => 'Běží',
-                                       'pool_running_deg' => 'Běží degradovaně',
-                                       'pool_running_inac' => 'Běží, ale není dostupný',
+                                       'pool-not-running' => 'Neaktivní',
+                                       'pool-building' => 'Staví se',
+                                       'pool-running' => 'Běží',
+                                       'pool-running-deg' => 'Běží degradovaně',
+                                       'pool-running-inac' => 'Běží, ale není dostupný',
                                        'unknown' => 'Neznámo',
-                                       'dom_running' => 'spuštěno',
-                                       'dom_nostate' => 'beze stavu',
-                                       'dom_blocked' => 'blokováno',
-                                       'dom_paused' =>  'zapauzovano',
-                                       'dom_shutdown' => 'vypnuto',
-                                       'dom_shutoff' => 'vypnuto',
-                                       'dom_crashed' => 'havarováno',
-                                       'cur_phys_size' => 'Aktuální fyzická velikost',
+                                       'dom-running' => 'spuštěno',
+                                       'dom-nostate' => 'beze stavu',
+                                       'dom-blocked' => 'blokováno',
+                                       'dom-paused' =>  'zapauzovano',
+                                       'dom-shutdown' => 'vypnuto',
+                                       'dom-shutoff' => 'vypnuto',
+                                       'dom-crashed' => 'havarováno',
+                                       'cur-phys-size' => 'Aktuální fyzická velikost',
                                        'diskless' => 'bez disku',
                                        'changes' => 'Změny',
-                                       'btn_apply' => 'Použít změny',
-                                       'btn_discard' => 'Zahodit změny',
-                                       'ask_apply' => 'Skutečně si přejete použít změny?',
-                                       'ask_discard' => 'Skutečně si přejete zahodit změny?',
+                                       'btn-apply' => 'Použít změny',
+                                       'btn-discard' => 'Zahodit změny',
+                                       'ask-apply' => 'Skutečně si přejete použít změny?',
+                                       'ask-discard' => 'Skutečně si přejete zahodit změny?',
                                        'general' => 'Obecné',
                                        'description' => 'Popis',
-                                       'vm_details' => 'Detaily virtuálního stroje',
-                                       'host_pcpu_info' => 'Informace o procesorech hostitele',
-                                       'max_per_guest' => 'Maximum pro VM',
-                                       'vm_vcpu_info' => 'Informace o procesorech virtuálního stroje',
-                                       'menu_overview' => 'Přehled',
-                                       'menu_processor' => 'Procesor',
-                                       'menu_memory' => 'Paměť',
-                                       'menu_boot' => 'Bootování',
-                                       'menu_disk' => 'Disková zařízení',
-                                       'menu_network' => 'Síťová zařízení',
-                                       'menu_multimedia' => 'Multimediální zařízení',
-                                       'menu_hostdev' => 'Zařízení z hostitele',
-                                       'menu_screenshot' => 'Snímek obrazovky',
-                                       'host_mem_info' => 'Informace o paměti hostitele',
-                                       'vm_mem_info' => 'Informace o paměti virtuálního stroje',
-                                       'total_mem' => 'Celková paměť',
-                                       'mem_alloc_cur' => 'Aktuální alokace',
-                                       'mem_alloc_max' => 'Maximální alokace',
-                                       'vm_boot_opts' => 'Nastavení bootovací sekvence virtuálního stroje',
-                                       'vm_boot_dev1' => 'První boot zařízení',
-                                       'vm_boot_dev2' => 'Druhé boot zařízení',
-                                       'vm_boot_hdd' => 'Pevný disk',
-                                       'vm_boot_cd' => 'CD-ROM',
-                                       'vm_boot_fda' => 'Disketová mechanika',
-                                       'vm_boot_pxe' => 'Síťový boot z PXE',
-                                       'vm_boot_none' => 'žádné',
-                                       'vm_disk_num' => 'Počet disků',
-                                       'vm_disk_storage' => 'Úložiště',
-                                       'vm_disk_type' => 'Typ ovladače',
-                                       'vm_disk_dev' => 'Zařízení',
-                                       'vm_disk_capacity' => 'Kapacita',
-                                       'vm_disk_allocation' => 'Alokace',
-                                       'vm_disk_physical' => 'Fyzická velikost',
-                                       'vm_disk_remove' => 'Odstranit disk',
-                                       'vm_disk_add' => 'Přidat disk',
-                                       'vm_disk_details' => 'Detaily o diskových zařízeních',
-                                       'vm_disk_askdel' => 'Skutečně si přejete smazat disk \'+disk+\' z domény?',
-                                       'vm_disk_askadd' => 'Skutečně si přejete přidat disk do domény?',
-                                       'vm_disk_image' => 'Obraz disku',
-                                       'vm_disk_location' => 'Umístění',
-                                       'vm_network_title' => 'Síťová zařízení stroje',
-                                       'vm_network_num' => 'Počet karet',
-                                       'vm_network_nic' => 'Síťová karta ',
-                                       'vm_network_mac' => 'MAC Adresa',
-                                       'vm_network_net' => 'Síť',
-                                       'vm_network_type' => 'Typ karty',
-                                       'vm_network_add' => 'Přidat novou kartu',
-                                       'vm_network_del' => 'Odstranit kartu',
-                                       'vm_network_askadd' => 'Skutečně si přejete přidat síťovou kartu do domény?',
-                                       'vm_network_askdel' => 'Skutečně si přejete smazat síťovou kartu s MAC adresou \'+mac+\' z domény?',
+                                       'vm-details' => 'Detaily virtuálního stroje',
+                                       'host-pcpu-info' => 'Informace o procesorech hostitele',
+                                       'max-per-guest' => 'Maximum pro VM',
+                                       'vm-vcpu-info' => 'Informace o procesorech virtuálního stroje',
+                                       'menu-overview' => 'Přehled',
+                                       'menu-processor' => 'Procesor',
+                                       'menu-memory' => 'Paměť',
+                                       'menu-boot' => 'Bootování',
+                                       'menu-disk' => 'Disková zařízení',
+                                       'menu-network' => 'Síťová zařízení',
+                                       'menu-multimedia' => 'Multimediální zařízení',
+                                       'menu-hostdev' => 'Zařízení z hostitele',
+                                       'menu-screenshot' => 'Snímek obrazovky',
+                                       'host-mem-info' => 'Informace o paměti hostitele',
+                                       'vm-mem-info' => 'Informace o paměti virtuálního stroje',
+                                       'total-mem' => 'Celková paměť',
+                                       'mem-alloc-cur' => 'Aktuální alokace',
+                                       'mem-alloc-max' => 'Maximální alokace',
+                                       'vm-boot-opts' => 'Nastavení bootovací sekvence virtuálního stroje',
+                                       'vm-boot-dev1' => 'První boot zařízení',
+                                       'vm-boot-dev2' => 'Druhé boot zařízení',
+                                       'vm-boot-hdd' => 'Pevný disk',
+                                       'vm-boot-cd' => 'CD-ROM',
+                                       'vm-boot-fda' => 'Disketová mechanika',
+                                       'vm-boot-pxe' => 'Síťový boot z PXE',
+                                       'vm-boot-none' => 'žádné',
+                                       'vm-disk-num' => 'Počet disků',
+                                       'vm-disk-storage' => 'Úložiště',
+                                       'vm-disk-type' => 'Typ ovladače',
+                                       'vm-disk-dev' => 'Zařízení',
+                                       'vm-disk-capacity' => 'Kapacita',
+                                       'vm-disk-allocation' => 'Alokace',
+                                       'vm-disk-physical' => 'Fyzická velikost',
+                                       'vm-disk-remove' => 'Odstranit disk',
+                                       'vm-disk-add' => 'Přidat disk',
+                                       'vm-disk-details' => 'Detaily o diskových zařízeních',
+                                       'vm-disk-askdel' => 'Skutečně si přejete smazat disk \'+disk+\' z domény?',
+                                       'vm-disk-askadd' => 'Skutečně si přejete přidat disk do domény?',
+                                       'vm-disk-image' => 'Obraz disku',
+                                       'vm-disk-location' => 'Umístění',
+                                       'vm-network-title' => 'Síťová zařízení stroje',
+                                       'vm-network-num' => 'Počet karet',
+                                       'vm-network-nic' => 'Síťová karta ',
+                                       'vm-network-mac' => 'MAC Adresa',
+                                       'vm-network-net' => 'Síť',
+                                       'vm-network-type' => 'Typ karty',
+                                       'vm-network-add' => 'Přidat novou kartu',
+                                       'vm-network-del' => 'Odstranit kartu',
+                                       'vm-network-askadd' => 'Skutečně si přejete přidat síťovou kartu do domény?',
+                                       'vm-network-askdel' => 'Skutečně si přejete smazat síťovou kartu s MAC adresou \'+mac+\' z domény?',
                                        'info'   => 'Informace',
-                                       'vm_title' => 'Virtuální stroj',
-                                       'vm_multimedia_title' => 'Multimediální zařízení stroje',
-                                       'vm_multimedia_console' => 'Konzole',
-                                       'vm_multimedia_input' => 'Vstupní zařízení',
-                                       'vm_multimedia_graphics' => 'Grafické zařízení',
-                                       'vm_multimedia_video' => 'Video zařízení',
-                                       'details_readonly' => 'žádné (tato stránka je zatím pouze pro čtení)',
-                                       'host_devices_title' => 'Zařízení předaná z hostitele',
-                                       'host_devices' => 'Zařízení z hostitele',
-                                       'hostdev_none' => 'žádná',
-                                       'info_msg' => '<p>Toto je ovládací panel virtuálních strojů napsaný v jazyce PHP. Můžete jej '.
+                                       'vm-title' => 'Virtuální stroj',
+                                       'vm-multimedia-title' => 'Multimediální zařízení stroje',
+                                       'vm-multimedia-console' => 'Konzole',
+                                       'vm-multimedia-input' => 'Vstupní zařízení',
+                                       'vm-multimedia-graphics' => 'Grafické zařízení',
+                                       'vm-multimedia-video' => 'Video zařízení',
+                                       'details-readonly' => 'žádné (tato stránka je zatím pouze pro čtení)',
+                                       'host-devices-title' => 'Zařízení předaná z hostitele',
+                                       'host-devices' => 'Zařízení z hostitele',
+                                       'hostdev-none' => 'žádná',
+                                       'info-msg' => '<p>Toto je ovládací panel virtuálních strojů napsaný v jazyce PHP. Můžete jej '.
                                                        'využít pro ovládání Vašich virtuálních strojů přes libvirt přímo z webového '.
                                                        'rozhraní. Pro navigaci prosím použijte horní menu a vyberte doménu (virtuální stroj) '.
                                                        'ze <i>Seznamu domén</i>. V seznamu domén uvidíte veškeré domény, které máte přístupné '.
                                        'conns'  => 'Připojení',
                                        'connname' => 'Název připojení',
                                        'hypervisor' => 'Hypervisor',
-                                       'host_type' => 'Typ hostitele',
-                                       'type_local' => 'Lokální',
-                                       'type_remote' => 'Vzdálený',
+                                       'host-type' => 'Typ hostitele',
+                                       'type-local' => 'Lokální',
+                                       'type-remote' => 'Vzdálený',
                                        'host' => 'Hostitel',
                                        'logfile' => 'Soubor protokolu',
                                        'actions' => 'Akce',
-                                       'log_opts' => 'Nastavení protokolování',
-                                       'host_opts' => 'Nastavení hostitele',
-                                       'save_conn' => 'Uložení připojení',
-                                       'connect_new' => 'Připojit na hostitele',
-                                       'change_conn' => 'Změnit nastavení připojení',
-                                       'conn_method' => 'Metoda připojení',
+                                       'log-opts' => 'Nastavení protokolování',
+                                       'host-opts' => 'Nastavení hostitele',
+                                       'save-conn' => 'Uložení připojení',
+                                       'connect-new' => 'Připojit na hostitele',
+                                       'change-conn' => 'Změnit nastavení připojení',
+                                       'conn-method' => 'Metoda připojení',
                                        'user' => 'Uživatelské jméno',
-                                       'conn_setup' => 'Nastavení připojení',
+                                       'conn-setup' => 'Nastavení připojení',
                                        'connect' => 'Připojit se',
-                                       'conn_remove' => 'Odebrat připojení',
-                                       'empty_disable_log' => 'Ponechte prázdné pro zakázání protokolování',
-                                       'empty_disable_save' => 'Ponechte prázdné pokud si nepřejete uložit připojení',
-                                       'conn_none' => 'Žádné připojení nebylo zatím definováno',
+                                       'conn-remove' => 'Odebrat připojení',
+                                       'empty-disable-log' => 'Ponechte prázdné pro zakázání protokolování',
+                                       'empty-disable-save' => 'Ponechte prázdné pokud si nepřejete uložit připojení',
+                                       'conn-none' => 'Žádné připojení nebylo zatím definováno',
                                        'name'   => 'Název',
                                        'arch'   => 'Architektura',
                                        'vcpus'  => 'Procesory',
                                        'state'  => 'Stav',
                                        'id'     => 'ID',
                                        'msg'    => 'Zpráva',
-                                       'dom_start' => 'Spustit doménu',
-                                       'dom_stop'  => 'Zastavit doménu',
-                                       'dom_destroy' => 'Zničit doménu',
-                                       'dom_dumpxml' => 'Zobrazit XML konfiguraci domény',
-                                       'dom_editxml' => 'Upravit XML konfiguraci domény',
-                                       'dom_xmldesc' => 'XML konfigurace domény',
-                                       'dom_start_ok' => 'Doména byla nastartována',
-                                       'dom_start_err' => 'Nastala chyba při startování domény',
-                                       'dom_shutdown_ok' => 'Příkaz k ukončení domény byl zaslán',
-                                       'dom_shutdown_err' => 'Nastala chyba při zasílání ukončovacího příkazu',
-                                       'dom_destroy_ok' => 'Doména byla ukončena',
-                                       'dom_destroy_err' => 'Nastala chyba při ukončování domény',
-                                       'dom_undefine_ok' => 'Doména byla úspěšně smazána',
-                                       'dom_undefine_err' => 'Nastala chyba při mazání domény',
-                                       'dom_define_changed' => 'Definice domény byla změněna',
-                                       'dom_define_change_err' => 'Nezdařilo se změnit definici domény',
-                                       'dom_undefine' => 'Smazat doménu',
-                                       'dom_undefine_question' => 'Doménu je možné smazat bez disků i včetně disků. Pokud zvolíte možnost smazání disků, pouze disky přiřazené danému virtuálnímu stroji budou smazané. Obrazy CD-ROM budou netknuté. Skutečně si přejete doménu smazat?',
+                                       'dom-start' => 'Spustit doménu',
+                                       'dom-stop'  => 'Zastavit doménu',
+                                       'dom-destroy' => 'Zničit doménu',
+                                       'dom-dumpxml' => 'Zobrazit XML konfiguraci domény',
+                                       'dom-editxml' => 'Upravit XML konfiguraci domény',
+                                       'dom-xmldesc' => 'XML konfigurace domény',
+                                       'dom-start-ok' => 'Doména byla nastartována',
+                                       'dom-start-err' => 'Nastala chyba při startování domény',
+                                       'dom-shutdown-ok' => 'Příkaz k ukončení domény byl zaslán',
+                                       'dom-shutdown-err' => 'Nastala chyba při zasílání ukončovacího příkazu',
+                                       'dom-destroy-ok' => 'Doména byla ukončena',
+                                       'dom-destroy-err' => 'Nastala chyba při ukončování domény',
+                                       'dom-undefine-ok' => 'Doména byla úspěšně smazána',
+                                       'dom-undefine-err' => 'Nastala chyba při mazání domény',
+                                       'dom-define-changed' => 'Definice domény byla změněna',
+                                       'dom-define-change-err' => 'Nezdařilo se změnit definici domény',
+                                       'dom-undefine' => 'Smazat doménu',
+                                       'dom-undefine-question' => 'Doménu je možné smazat bez disků i včetně disků. Pokud zvolíte možnost smazání disků, pouze disky přiřazené danému virtuálnímu stroji budou smazané. Obrazy CD-ROM budou netknuté. Skutečně si přejete doménu smazat?',
                                        'delete' => 'Smazat',
-                                       'delete_with_disks' => 'Smazat i s disky',
-                                       'changed_uri' => 'Změněno nastavení připojovacího řetězce URI na ',
-                                       'click_reload' => 'Klikněte zde pro obnovení a připojení pomocí nového připojovacího řetězce',
-                                       'conn_saved' => 'Připojení bylo uloženo',
-                                       'conn_failed' => 'Připojení selhalo',
-                                       'domain_list' => 'Seznam domén',
-                                       'network_list' => 'Seznam sítí',
-                                       'dom_screenshot' => 'Snímek obrazovky',
+                                       'delete-with-disks' => 'Smazat i s disky',
+                                       'changed-uri' => 'Změněno nastavení připojovacího řetězce URI na ',
+                                       'click-reload' => 'Klikněte zde pro obnovení a připojení pomocí nového připojovacího řetězce',
+                                       'conn-saved' => 'Připojení bylo uloženo',
+                                       'conn-failed' => 'Připojení selhalo',
+                                       'domain-list' => 'Seznam domén',
+                                       'network-list' => 'Seznam sítí',
+                                       'dom-screenshot' => 'Snímek obrazovky',
                                        'settings' => 'Nastavení',
-                                       'interval_sec' => 'Interval (sekund)',
+                                       'interval-sec' => 'Interval (sekund)',
                                        'change' => 'Změnit',
-                                       'dom_none' => 'Žádná platná doména zde není definovaná',
-                                       'main_menu' => 'Hlavní menu',
-                                       'cannot_connect' => 'Nezdařilo se připojení k hypervisoru. Prosím zkontrolujte nastavení.',
+                                       'dom-none' => 'Žádná platná doména zde není definovaná',
+                                       'main-menu' => 'Hlavní menu',
+                                       'cannot-connect' => 'Nezdařilo se připojení k hypervisoru. Prosím zkontrolujte nastavení.',
                                        'language' => 'Jazyk',
                                        'using-ssh-auth' => 'Jak používat SSH authentizaci',
                                        'info-apache-key-copy' => 'K projektu php-virt-control je přibalena utilita <b>apache-key-copy</b> (možno nalézt v podadresáři tools), '.
                                        'new-vm-existing' => 'Použít existující disk',
                                        'new-vm-create' => 'Vytvořit nový disk',
                                        'vm-disk-size' => 'Nová velikost disku',
-                                       'net_ip' => 'IP adresa',
-                                       'net_mask' => 'Maska podsítě',
-                                       'net_range' => 'Rozsah IP adres',
-                                       'net_forward' => 'Směrování',
-                                       'net_dev' => 'Zařízení pro směrování',
-                                       'net_dhcp_range' => 'Rozsah DHCP',
-                                       'net_active' => 'Aktivní',
+                                       'net-ip' => 'IP adresa',
+                                       'net-mask' => 'Maska podsítě',
+                                       'net-range' => 'Rozsah IP adres',
+                                       'net-forward' => 'Směrování',
+                                       'net-dev' => 'Zařízení pro směrování',
+                                       'net-dhcp-range' => 'Rozsah DHCP',
+                                       'net-active' => 'Aktivní',
                                        'create-new-network' => 'Vytvořit novou síť',
-                                       'net_start' => 'Povolit síť',
-                                       'net_dumpxml' => 'Zobrazit XML konfiguraci',
-                                       'net_editxml' => 'Editovat XML konfiguraci',
-                                       'net_undefine' => 'Smazat síť',
-                                       'net_stop' => 'Zakázat síť',
-                                       'net_xmldesc' => 'XML konfigurace sítě',
-                                       'net_editxml' => 'Upravit XML konfiguraci sítě',
-                                       'net_define_changed' => 'Konfigurace sítě byla změněna',
-                                       'net_define_change_err' => 'Nastala chyba při změně konfigurace sítě',
-                                       'net_start_ok' => 'Síť byla úspěšně povolena (zapnuta)',
-                                       'net_start_err' => 'Nastala chyba při startování sítě',
-                                       'net_stop_ok' => 'Síť byla úspěšně zakázána (vypnuta)',
-                                       'net_stop_err' => 'Nastala chyba při zakazování sítě',
-                                       'net_undefine_question' => 'Skutečně si přejete danou síť smazat?',
-                                       'net_undefine_ok' => 'Síť byla úspěšně smazána',
-                                       'net_undefine_err' => 'Nastala chyba při mazání sítě',
-                                       'net_ip_range_def' => 'Definice rozsahu',
-                                       'net_ip_cidr' => 'CIDR (192.168.111.0/24)',
-                                       'net_ip_direct' => 'Definice IP adresy a masky',
-                                       'net_ipdef_cidr' => 'CIDR Definice',
+                                       'net-start' => 'Povolit síť',
+                                       'net-dumpxml' => 'Zobrazit XML konfiguraci',
+                                       'net-editxml' => 'Editovat XML konfiguraci',
+                                       'net-undefine' => 'Smazat síť',
+                                       'net-stop' => 'Zakázat síť',
+                                       'net-xmldesc' => 'XML konfigurace sítě',
+                                       'net-editxml' => 'Upravit XML konfiguraci sítě',
+                                       'net-define-changed' => 'Konfigurace sítě byla změněna',
+                                       'net-define-change-err' => 'Nastala chyba při změně konfigurace sítě',
+                                       'net-start-ok' => 'Síť byla úspěšně povolena (zapnuta)',
+                                       'net-start-err' => 'Nastala chyba při startování sítě',
+                                       'net-stop-ok' => 'Síť byla úspěšně zakázána (vypnuta)',
+                                       'net-stop-err' => 'Nastala chyba při zakazování sítě',
+                                       'net-undefine-question' => 'Skutečně si přejete danou síť smazat?',
+                                       'net-undefine-ok' => 'Síť byla úspěšně smazána',
+                                       'net-undefine-err' => 'Nastala chyba při mazání sítě',
+                                       'net-ip-range-def' => 'Definice rozsahu',
+                                       'net-ip-cidr' => 'CIDR (192.168.111.0/24)',
+                                       'net-ip-direct' => 'Definice IP adresy a masky',
+                                       'net-ipdef-cidr' => 'CIDR Definice',
                                        'dhcp' => 'DHCP',
-                                       'net_dhcp_start' => 'Počátek DHCP rozsahu',
-                                       'net_dhcp_end' => 'Konec DHCP rozsahu',
-                                       'net_forward_none' => 'žádné',
-                                       'net_forward_nat' => 'NAT',
-                                       'net_forward_route' => 'Route',
-                                       'net_forward_dev_empty_msg' => 'Nevyplňujte pro možnost směrování na jakékoli zařízení',
-                                       'net_forward_dev_any' => 'jakékoli zařízení',
-                                       'net_created' => 'Síť byla vytvořena úspěšně',
+                                       'net-dhcp-start' => 'Počátek DHCP rozsahu',
+                                       'net-dhcp-end' => 'Konec DHCP rozsahu',
+                                       'net-forward-none' => 'žádné',
+                                       'net-forward-nat' => 'NAT',
+                                       'net-forward-route' => 'Route',
+                                       'net-forward-dev-empty-msg' => 'Nevyplňujte pro možnost směrování na jakékoli zařízení',
+                                       'net-forward-dev-any' => 'jakékoli zařízení',
+                                       'net-created' => 'Síť byla vytvořena úspěšně',
                                        'new-vm-created' => 'Virtuální stroj byl úspěšně vytvořen',
                                        'network-add-ok' => 'Síťová karta byla úspěšně přidána. Změny se projeví po dalším restartu domény.',
                                        'network-add-error' => 'Nelze přidat síťovou kartu do domény',
                                        'network-generate-mac' => 'Vygenerovat novou MAC adresu',
                                        'network-remove-ok' => 'Síťové karta byla úspěšně odebrána. Změny se projeví po dalším restartu domény.',
                                        'network-remove-error' => 'Nelze odebrat síťovou kartu',
-                                       'login_page_title' => 'Přihlášení',
-                                       'login_enter_login' => 'Jméno:',
-                                       'login_enter_password' => 'Heslo:',
-                                       'login_submit' => 'Přihlásit',
-                                       'login_invalid' => 'Vaše přihlašovací údaje nejsou platné. Prosím zadejte správné údaje pro přihlášení',
+                                       'login-page-title' => 'Přihlášení',
+                                       'login-enter-login' => 'Jméno:',
+                                       'login-enter-password' => 'Heslo:',
+                                       'login-submit' => 'Přihlásit',
+                                       'login-invalid' => 'Vaše přihlašovací údaje nejsou platné. Prosím zadejte správné údaje pro přihlášení',
                                        'logout' => 'Odhlásit se',
 
                                        'users' => 'Uživatelé',
                                        'create-new-user' => 'Vytvořit nového uživatele',
-                                       'user_add' => 'Přidat uživatele',
-                                       'user_edit' => 'Editovat uživatele',
-                                       'user_del' => 'Smazat uživatele',
-                                       'user_del_confirm' => 'Skutečně si přejete daného uživatele smazat?',
-                                       'user_added' => 'Uživatel byl úspěšně přidán',
-                                       'user_edited' => 'Uživatelské informace byly úspěšně upraveny',
-                                       'user_deleted' => 'Uživatel byl úspěšně smazán',
-                                       'confirm_password' => 'Potvrzení hesla',
+                                       'user-add' => 'Přidat uživatele',
+                                       'user-edit' => 'Editovat uživatele',
+                                       'user-del' => 'Smazat uživatele',
+                                       'user-del-confirm' => 'Skutečně si přejete daného uživatele smazat?',
+                                       'user-added' => 'Uživatel byl úspěšně přidán',
+                                       'user-edited' => 'Uživatelské informace byly úspěšně upraveny',
+                                       'user-deleted' => 'Uživatel byl úspěšně smazán',
+                                       'confirm-password' => 'Potvrzení hesla',
                                        'permissions' => 'Oprávnění',
-                                       'permission_basic' => 'Obecný přístup',
-                                       'permission_save_connection' => 'Uložit nastavení',
-                                       'permission_vm_create' => 'Vytvořit virtuální stroj',
-                                       'permission_vm_edit' => 'Upravit virtuální stroj',
-                                       'permission_vm_delete' => 'Smazat virtuální stroj',
-                                       'permission_network_create' => 'Vytvořit virtuální síť',
-                                       'permission_network_edit' => 'Upravit virtuální síť',
-                                       'permission_network_delete' => 'Smazat virtuální síť',
-                                       'permission_user_create' => 'Vytvořit nového uživatele',
-                                       'permission_user_edit' => 'Upravit stávajícího uživatele',
-                                       'permission_user_delete' => 'Smazat uživatele',
-                                       'user_add_btn' => 'Přidat uživatele',
-                                       'user_edit_btn' => 'Upravit uživatele',
-                                       'password_mismatch' => 'Heslo nebylo ověřeno',
+                                       'permission-basic' => 'Obecný přístup',
+                                       'permission-save-connection' => 'Uložit nastavení',
+                                       'permission-vm-create' => 'Vytvořit virtuální stroj',
+                                       'permission-vm-edit' => 'Upravit virtuální stroj',
+                                       'permission-vm-delete' => 'Smazat virtuální stroj',
+                                       'permission-network-create' => 'Vytvořit virtuální síť',
+                                       'permission-network-edit' => 'Upravit virtuální síť',
+                                       'permission-network-delete' => 'Smazat virtuální síť',
+                                       'permission-user-create' => 'Vytvořit nového uživatele',
+                                       'permission-user-edit' => 'Upravit stávajícího uživatele',
+                                       'permission-user-delete' => 'Smazat uživatele',
+                                       'user-add-btn' => 'Přidat uživatele',
+                                       'user-edit-btn' => 'Upravit uživatele',
+                                       'password-mismatch' => 'Heslo nebylo ověřeno',
                                        'screenshot-settings-auto-release' => 'Automaticky poslat událost uvolnění tlačítka myši',
                                        'screenshot-delay' => 'Interval byl změněn na %d sekund',
-                                       'cpu_stats' => 'CPU Statistiky uzlu (průměr za sekundu)',
-                                       'mem_stats' => 'Paměťové statistiky uzlu',
-                                       'system_information' => 'Systémové informace',
+                                       'cpu-stats' => 'CPU Statistiky uzlu (průměr za sekundu)',
+                                       'mem-stats' => 'Paměťové statistiky uzlu',
+                                       'system-information' => 'Systémové informace',
                                        'date-format' => 'd.m.Y H:i:s',
                                        'run' => 'Spuštění',
                                        'no-destination-present' => 'Žádný cíl není dostupný či na něj nejste připojeni',
                                        'choose-destination' => 'Zvolte cíl migrace',
-                                       'dom_migrate' => 'Migrovat doménu',
-                                       'cpu_stats_per_each_cpu' => 'CPU Statistiky uzlu pro jednotlivá CPU (průměr za sekundu)',
+                                       'dom-migrate' => 'Migrovat doménu',
+                                       'cpu-stats-per-each-cpu' => 'CPU Statistiky uzlu pro jednotlivá CPU (průměr za sekundu)',
+                                       'net-none' => 'Žádná síť není definovaná na daném spojení',
+                                       'disk-removed' => 'Disk byl úspěšně odebrán',
+                                       'disk-not-remove' => 'Nelze odebrat disk',
+                                       'disk-added' => 'Disk byl úspěšně přidán',
+                                       'disk-not-added' => 'Disk nelze přidat',
+                                       'boot-order-changed' => 'Startovací volby byly změněny',
+                                       'boot-order-change-error' => 'Nelze změnit volby startu systému',
+
+                                       'mem-alloc-changed' => 'Paměť přidělená doméněu byla změněna',
+                                       'mem-alloc-change-error' => 'Nelze změnit přidělenou paměť',
                                        );
 ?>
index bd98165..51dbe71 100644 (file)
@@ -2,23 +2,23 @@
                $lang_name = 'English';
                $lang_code = 'en';
                $trans = array(
-                                       'title_vmc' => 'Virtual Machine Controller',
+                                       'title-vmc' => 'Virtual Machine Controller',
                                        'info'   => 'Information',
-                                       'for_php' => 'for PHP',
-                                       'conn_details' => 'Connection details',
-                                       'conn_uri' => 'Connection URI',
-                                       'conn_encrypted' => 'Encrypted',
-                                       'conn_secure' => 'Secure',
-                                       'connected_to' => 'Connected to',
-                                       'no_iso' => 'No ISO install image is present',
-                                       'hypervisor_limit' => 'Hypervisor limit',
+                                       'for-php' => 'for PHP',
+                                       'conn-details' => 'Connection details',
+                                       'conn-uri' => 'Connection URI',
+                                       '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',
                                        'Yes' => 'Yes',
                                        'No' => 'No',
-                                       'error_page_title' => 'Error',
-                                       'error_connection_db_label' => 'DB Error',
-                                       'error_connection_db_text' => 'The connection to your database has failed.',
+                                       'error-page-title' => 'Error',
+                                       'error-connection-db-label' => 'DB Error',
+                                       'error-connection-db-text' => 'The connection to your database has failed.',
                                        'no-datafile' => 'Data file is missing.t',
                                        'no-server' => 'Server definition is missing in the data file.',
                                        'no-user' => 'User definition is missing in the data file.',
                                        'no-dbname' => 'Database name definition is missing in the data file.',
                                        'db-failure-connect' => 'Cannot connect to database. Please check your configuration.',
                                        'db-failure-select' => 'Cannot select database name. Please check your configuration.',
-                                       'error_page_label' => 'Page not found:',
-                                       'error_page_text' => 'The page you were looking for was not found. Please report to the administrator and try again later.',
-                                       'error_missing_label' => 'Missing dependency:',
-                                       'error_missing_text' => 'Your PHP configuration is missing libvirt-php module which is necessary to maintain virtual machines. Please install libvirt-php from <a href="http://libvirt.org/php">http://libvirt.php</a> first.',
-                                       'error_need_update_label' => 'Update needed:',
-                                       'error_need_update_text' => 'Your version of libvirt-php module is too old for this application to work properly. Please upgrade your libvirt-php version from <a href="http://libvirt.org/php">http://libvirt.php</a> first.',
-                                       'host_details' => 'Host details',
+                                       'error-page-label' => 'Page not found:',
+                                       'error-page-text' => 'The page you were looking for was not found. Please report to the administrator and try again later.',
+                                       'error-missing-label' => 'Missing dependency:',
+                                       'error-missing-text' => 'Your PHP configuration is missing libvirt-php module which is necessary to maintain virtual machines. Please install libvirt-php from <a href="http://libvirt.org/php">http://libvirt.php</a> first.',
+                                       'error-need-update-label' => 'Update needed:',
+                                       'error-need-update-text' => 'Your version of libvirt-php module is too old for this application to work properly. Please upgrade your libvirt-php version from <a href="http://libvirt.org/php">http://libvirt.php</a> first.',
+                                       'host-details' => 'Host details',
                                        'model' => 'Model',
                                        'pcpus' => 'CPUs/cores',
-                                       'cpu_speed' => 'CPU Speed',
+                                       'cpu-speed' => 'CPU Speed',
                                        'modinfo' => 'libvirt PHP module information',
                                        'version' => 'Version',
                                        'website' => 'Website',
-                                       'pool_not_running' => 'Not running',
-                                       'pool_building' => 'Building pool',
-                                       'pool_running' => 'Running',
-                                       'pool_running_deg' => 'Running degraded',
-                                       'pool_running_inac' => 'Running but inaccessible',
+                                       'pool-not-running' => 'Not running',
+                                       'pool-building' => 'Building pool',
+                                       'pool-running' => 'Running',
+                                       'pool-running-deg' => 'Running degraded',
+                                       'pool-running-inac' => 'Running but inaccessible',
                                        'unknown' => 'Unknown',
-                                       'dom_running' => 'running',
-                                       'dom_nostate' => 'no state',
-                                       'dom_blocked' => 'blocked',
-                                       'dom_paused' =>  'paused',
-                                       'dom_shutdown' => 'shutdown',
-                                       'dom_shutoff' => 'shutoff',
-                                       'dom_crashed' => 'crashed',
-                                       'cur_phys_size' => 'Current physical size',
+                                       'dom-running' => 'running',
+                                       'dom-nostate' => 'no state',
+                                       'dom-blocked' => 'blocked',
+                                       'dom-paused' =>  'paused',
+                                       'dom-shutdown' => 'shutdown',
+                                       'dom-shutoff' => 'shutoff',
+                                       'dom-crashed' => 'crashed',
+                                       'cur-phys-size' => 'Current physical size',
                                        'diskless' => 'diskless',
                                        'changes' => 'Changes',
-                                       'btn_apply' => 'Apply changes',
-                                       'btn_discard' => 'Discard changes',
-                                       'ask_apply' => 'Do you really want to apply your changes?',
-                                       'ask_discard' => 'Do you really want to discard your changes?',
+                                       'btn-apply' => 'Apply changes',
+                                       'btn-discard' => 'Discard changes',
+                                       'ask-apply' => 'Do you really want to apply your changes?',
+                                       'ask-discard' => 'Do you really want to discard your changes?',
                                        'general' => 'General',
                                        'description' => 'Description',
-                                       'vm_details' => 'Machine details',
-                                       'host_pcpu_info' => 'Host processor information',
-                                       'max_per_guest' => 'Max. per guest',
-                                       'vm_vcpu_info' => 'Machine processor information',
-                                       'host_mem_info' => 'Host memory information',
-                                       'vm_mem_info' => 'Machine memory information',
-                                       'total_mem' => 'Total memory',
-                                       'mem_alloc_cur' => 'Current allocation',
-                                       'mem_alloc_max' => 'Max. allocation',
-                                       'vm_boot_opts' => 'Virtual machine boot options',
-                                       'vm_boot_dev1' => 'First boot device',
-                                       'vm_boot_dev2' => 'Second boot device',
-                                       'vm_boot_hdd' => 'Hard-drive',
-                                       'vm_boot_cd' => 'CD-ROM',
-                                       'vm_boot_fda' => 'Floppy',
-                                       'vm_boot_pxe' => 'Network boot (PXE)',
-                                       'vm_boot_none' => 'none',
-                                       'vm_disk_num' => 'Number of disks',
-                                       'vm_disk_storage' => 'Storage',
-                                       'vm_disk_type' => 'Driver type',
-                                       'vm_disk_dev' => 'Domain device',
-                                       'vm_disk_capacity' => 'Capacity',
-                                       'vm_disk_allocation' => 'Allocation',
-                                       'vm_disk_physical' => 'Physical disk size',
-                                       'vm_disk_remove' => 'Remove disk',
-                                       'vm_disk_add' => 'Add new disk',
-                                       'vm_disk_image' => 'Disk image',
-                                       'vm_disk_location' => 'Disk location',
-                                       'vm_disk_details' => 'Machine disk device details',
-                                       'vm_disk_askdel' => 'Are you sure you want to delete disk \'+disk+\' from the guest?',
-                                       'vm_disk_askadd' => 'Are you sure you want to add disk to the guest?',
-                                       'vm_network_title' => 'Machine network devices',
-                                       'vm_network_num' => 'Number of NICs',
-                                       'vm_network_nic' => 'Network interface card ',
-                                       'vm_network_mac' => 'MAC Address',
-                                       'vm_network_net' => 'Network',
-                                       'vm_network_type' => 'NIC Type',
-                                       'vm_network_add' => 'Add a new network interface',
-                                       'vm_network_del' => 'Remove network interface',
-                                       'vm_network_askadd' => 'Do you really want to add a new network interface card ?',
-                                       'vm_network_askdel' => 'Are you sure you want to delete interface with MAC address \'+mac+\' from the guest?',
-                                       'vm_title' => 'Virtual machine',
-                                       'vm_multimedia_title' => 'Machine multimedia devices',
-                                       'vm_multimedia_console' => 'Console',
-                                       'vm_multimedia_input' => 'Input device',
-                                       'vm_multimedia_graphics' => 'Graphics device',
-                                       'vm_multimedia_video' => 'Video device',
-                                       'details_readonly' => 'None (this page is currently read-only)',
-                                       'host_devices_title' => 'Machine host devices',
-                                       'host_devices' => 'Host devices',
+                                       'vm-details' => 'Machine details',
+                                       'host-pcpu-info' => 'Host processor information',
+                                       'max-per-guest' => 'Max. per guest',
+                                       'vm-vcpu-info' => 'Machine processor information',
+                                       'host-mem-info' => 'Host memory information',
+                                       'vm-mem-info' => 'Machine memory information',
+                                       'total-mem' => 'Total memory',
+                                       'mem-alloc-cur' => 'Current allocation',
+                                       'mem-alloc-max' => 'Max. allocation',
+                                       'vm-boot-opts' => 'Virtual machine boot options',
+                                       'vm-boot-dev1' => 'First boot device',
+                                       'vm-boot-dev2' => 'Second boot device',
+                                       'vm-boot-hdd' => 'Hard-drive',
+                                       'vm-boot-cd' => 'CD-ROM',
+                                       'vm-boot-fda' => 'Floppy',
+                                       'vm-boot-pxe' => 'Network boot (PXE)',
+                                       'vm-boot-none' => 'none',
+                                       'vm-disk-num' => 'Number of disks',
+                                       'vm-disk-storage' => 'Storage',
+                                       'vm-disk-type' => 'Driver type',
+                                       'vm-disk-dev' => 'Domain device',
+                                       'vm-disk-capacity' => 'Capacity',
+                                       'vm-disk-allocation' => 'Allocation',
+                                       'vm-disk-physical' => 'Physical disk size',
+                                       'vm-disk-remove' => 'Remove disk',
+                                       'vm-disk-add' => 'Add new disk',
+                                       'vm-disk-image' => 'Disk image',
+                                       'vm-disk-location' => 'Disk location',
+                                       'vm-disk-details' => 'Machine disk device details',
+                                       'vm-disk-askdel' => 'Are you sure you want to delete disk \'+disk+\' from the guest?',
+                                       'vm-disk-askadd' => 'Are you sure you want to add disk to the guest?',
+                                       'vm-network-title' => 'Machine network devices',
+                                       'vm-network-num' => 'Number of NICs',
+                                       'vm-network-nic' => 'Network interface card ',
+                                       'vm-network-mac' => 'MAC Address',
+                                       'vm-network-net' => 'Network',
+                                       'vm-network-type' => 'NIC Type',
+                                       'vm-network-add' => 'Add a new network interface',
+                                       'vm-network-del' => 'Remove network interface',
+                                       'vm-network-askadd' => 'Do you really want to add a new network interface card ?',
+                                       'vm-network-askdel' => 'Are you sure you want to delete interface with MAC address \'+mac+\' from the guest?',
+                                       'vm-title' => 'Virtual machine',
+                                       'vm-multimedia-title' => 'Machine multimedia devices',
+                                       'vm-multimedia-console' => 'Console',
+                                       'vm-multimedia-input' => 'Input device',
+                                       'vm-multimedia-graphics' => 'Graphics device',
+                                       'vm-multimedia-video' => 'Video device',
+                                       'details-readonly' => 'None (this page is currently read-only)',
+                                       'host-devices-title' => 'Machine host devices',
+                                       'host-devices' => 'Host devices',
                                        'settings' => 'Settings',
-                                       'interval_sec' => 'Interval (sec)',
+                                       'interval-sec' => 'Interval (sec)',
                                        'change' => 'Change',
-                                       'menu_overview' => 'Overview',
-                                       'menu_processor' => 'Processor',
-                                       'menu_memory' => 'Memory',
-                                       'menu_boot' => 'Boot options',
-                                       'menu_disk' => 'Disk devices',
-                                       'menu_network' => 'Network devices',
-                                       'menu_multimedia' => 'Multimedia devices',
-                                       'menu_hostdev' => 'Host devices',
-                                       'menu_screenshot' => 'Screenshot',
-                                       'info_msg' => '<p>This is the virtual machine controller tool written in PHP language.'.
+                                       'menu-overview' => 'Overview',
+                                       'menu-processor' => 'Processor',
+                                       'menu-memory' => 'Memory',
+                                       'menu-boot' => 'Boot options',
+                                       'menu-disk' => 'Disk devices',
+                                       'menu-network' => 'Network devices',
+                                       'menu-multimedia' => 'Multimedia devices',
+                                       'menu-hostdev' => 'Host devices',
+                                       'menu-screenshot' => 'Screenshot',
+                                       'info-msg' => '<p>This is the virtual machine controller tool written in PHP language.'.
                                                        'You can manage virtual machines (guests) on your machines using this web-based '.
                                                        'controlling interface. For the navigation please use the upper menu and select '.
                                                        'the domain from the <i>Domain list</i> link to see the virtual machines available '.
                                        'conns'  => 'Connections',
                                        'connname' => 'Connection name',
                                        'hypervisor' => 'Hypervisor',
-                                       'host_type' => 'Host type',
-                                       'type_local' => 'Local',
-                                       'type_remote' => 'Remote',
+                                       'host-type' => 'Host type',
+                                       'type-local' => 'Local',
+                                       'type-remote' => 'Remote',
                                        'host' => 'Host',
                                        'logfile' => 'Log file',
                                        'actions' => 'Actions',
-                                       'log_opts' => 'Logging options',
-                                       'host_opts' => 'Host options',
-                                       'save_conn' => 'Save connection',
-                                       'connect_new' => 'Connect to the new host',
-                                       'change_conn' => 'Change host connection',
-                                       'conn_method' => 'Connection method',
+                                       'log-opts' => 'Logging options',
+                                       'host-opts' => 'Host options',
+                                       'save-conn' => 'Save connection',
+                                       'connect-new' => 'Connect to the new host',
+                                       'change-conn' => 'Change host connection',
+                                       'conn-method' => 'Connection method',
                                        'user' => 'User name',
-                                       'conn_setup' => 'Setup connection',
+                                       'conn-setup' => 'Setup connection',
                                        'connect' => 'Connect',
-                                       'conn_remove' => 'Remove connection',
-                                       'empty_disable_log' => 'Leave empty to disable logging',
-                                       'empty_disable_save' => 'Leave empty not to save connection',
-                                       'conn_none' => 'No connection defined',
-                                       'hostdev_none' => 'None',
+                                       'conn-remove' => 'Remove connection',
+                                       'empty-disable-log' => 'Leave empty to disable logging',
+                                       'empty-disable-save' => 'Leave empty not to save connection',
+                                       'conn-none' => 'No connection defined',
+                                       'hostdev-none' => 'None',
                                        'name'   => 'Name',
                                        'arch'   => 'Architecture',
                                        'vcpus'  => 'vCPUs',
                                        'state'  => 'State',
                                        'id'     => 'ID',
                                        'msg'    => 'Message',
-                                       'dom_start' => 'Start domain',
-                                       'dom_stop'  => 'Stop domain',
-                                       'dom_destroy' => 'Destroy domain',
-                                       'dom_dumpxml' => 'Dump domain XML',
-                                       'dom_editxml' => 'Edit domain XML',
-                                       'dom_xmldesc' => 'Domain XML description',
-                                       'dom_undefine' => 'Undefine domain',
-                                       'dom_start_ok' => 'Domain has been started successfully',
-                                       'dom_start_err' => 'Error while starting domain',
-                                       'dom_shutdown_ok' => 'Command to shutdown domain sent successfully',
-                                       'dom_shutdown_err' => 'Error while sending shutdown command',
-                                       'dom_destroy_ok' => 'Domain has been destroyed successfully',
-                                       'dom_destroy_err' => 'Error while destroying domain',
-                                       'dom_undefine_ok' => 'Domain has been undefined successfully',
-                                       'dom_undefine_err' => 'Error while undefining domain',
-                                       'dom_define_changed' => 'Domain definition has been changed',
-                                       'dom_define_change_err' => 'Cannot change domain definition',
-                                       'dom_undefine_question' => 'You can delete the domain with or without disks assigned to the domain. If you select option to delete disks only the domain disks will get deleted and the CD-ROM images will be intact. Are you sure you want to delete (undefine) this domain?',
+                                       'dom-start' => 'Start domain',
+                                       'dom-stop'  => 'Stop domain',
+                                       'dom-destroy' => 'Destroy domain',
+                                       'dom-dumpxml' => 'Dump domain XML',
+                                       'dom-editxml' => 'Edit domain XML',
+                                       'dom-xmldesc' => 'Domain XML description',
+                                       'dom-undefine' => 'Undefine domain',
+                                       'dom-start-ok' => 'Domain has been started successfully',
+                                       'dom-start-err' => 'Error while starting domain',
+                                       'dom-shutdown-ok' => 'Command to shutdown domain sent successfully',
+                                       'dom-shutdown-err' => 'Error while sending shutdown command',
+                                       'dom-destroy-ok' => 'Domain has been destroyed successfully',
+                                       'dom-destroy-err' => 'Error while destroying domain',
+                                       'dom-undefine-ok' => 'Domain has been undefined successfully',
+                                       'dom-undefine-err' => 'Error while undefining domain',
+                                       'dom-define-changed' => 'Domain definition has been changed',
+                                       'dom-define-change-err' => 'Cannot change domain definition',
+                                       'dom-undefine-question' => 'You can delete the domain with or without disks assigned to the domain. If you select option to delete disks only the domain disks will get deleted and the CD-ROM images will be intact. Are you sure you want to delete (undefine) this domain?',
                                        'delete' => 'Delete',
-                                       'delete_with_disks' => 'Delete with disks',
-                                       'changed_uri' => 'Changed connection URI to',
-                                       'click_reload' => 'Click here to reload and connect using new URI',
-                                       'conn_saved' => 'Connection has been saved to the list.',
-                                       'conn_failed' => 'Connection has failed',
-                                       'domain_list' => 'Domain list',
-                                       'dom_screenshot' => 'Screenshot',
-                                       'network_list' => 'Network list',
-                                       'dom_none' => 'No valid domain defined',
-                                       'main_menu' => 'Main menu',
-                                       'cannot_connect' => 'Cannot connect to hypervisor. Please change connection information.',
+                                       'delete-with-disks' => 'Delete with disks',
+                                       'changed-uri' => 'Changed connection URI to',
+                                       'click-reload' => 'Click here to reload and connect using new URI',
+                                       'conn-saved' => 'Connection has been saved to the list.',
+                                       'conn-failed' => 'Connection has failed',
+                                       'domain-list' => 'Domain list',
+                                       'dom-screenshot' => 'Screenshot',
+                                       'network-list' => 'Network list',
+                                       'dom-none' => 'No valid domain defined',
+                                       'main-menu' => 'Main menu',
+                                       'cannot-connect' => 'Cannot connect to hypervisor. Please change connection information.',
                                        'language' => 'Language',
                                        'using-ssh-auth' => 'Using SSH authentication',
                                        'info-apache-key-copy' => 'There\'s an utility called <b>apache-key-copy</b> included to this web-application (can be found in tools subdir) '.
                                        'new-vm-existing' => 'Use existing disk image',
                                        'new-vm-create' => 'Create new disk image',
                                        'vm-disk-size' => 'New disk size',
-                                       'net_ip' => 'IP Address',
-                                       'net_mask' => 'Subnet mask',
-                                       'net_range' => 'IP Range',
-                                       'net_forward' => 'Forwarding',
-                                       'net_dev' => 'Forwarding to device',
-                                       'net_dhcp_range' => 'DHCP Range',
-                                       'net_active' => 'Active',
+                                       'net-ip' => 'IP Address',
+                                       'net-mask' => 'Subnet mask',
+                                       'net-range' => 'IP Range',
+                                       'net-forward' => 'Forwarding',
+                                       'net-dev' => 'Forwarding to device',
+                                       'net-dhcp-range' => 'DHCP Range',
+                                       'net-active' => 'Active',
                                        'create-new-network' => 'Create a new network',
-                                       'net_start' => 'Start network',
-                                       'net_dumpxml' => 'Dump network XML',
-                                       'net_editxml' => 'Edit network XML',
-                                       'net_undefine' => 'Undefine network',
-                                       'net_stop' => 'Stop network',
-                                       'net_xmldesc' => 'Network XML description',
-                                       'net_editxml' => 'Edit network XML description',
-                                       'net_define_changed' => 'Network definition changed',
-                                       'net_define_change_err' => 'Error occurred while changing network definition',
-                                       'net_start_ok' => 'Network has been started successfully',
-                                       'net_start_err' => 'An error occurred while starting the network',
-                                       'net_stop_ok' => 'Network has been stopped successfully',
-                                       'net_stop_err' => 'An error occurred while stopping the network',
-                                       'net_undefine_question' => 'Do you really want to undefine this network?',
-                                       'net_undefine_ok' => 'Network has been successfully undefined',
-                                       'net_undefine_err' => 'An error occurred while undefining the network',
-                                       'net_ip_range_def' => 'Range definition',
-                                       'net_ip_cidr' => 'CIDR (192.168.111.0/24)',
-                                       'net_ip_direct' => 'IP and mask definition',
-                                       'net_ipdef_cidr' => 'CIDR Definition',
+                                       'net-start' => 'Start network',
+                                       'net-dumpxml' => 'Dump network XML',
+                                       'net-editxml' => 'Edit network XML',
+                                       'net-undefine' => 'Undefine network',
+                                       'net-stop' => 'Stop network',
+                                       'net-xmldesc' => 'Network XML description',
+                                       'net-editxml' => 'Edit network XML description',
+                                       'net-define-changed' => 'Network definition changed',
+                                       'net-define-change-err' => 'Error occurred while changing network definition',
+                                       'net-start-ok' => 'Network has been started successfully',
+                                       'net-start-err' => 'An error occurred while starting the network',
+                                       'net-stop-ok' => 'Network has been stopped successfully',
+                                       'net-stop-err' => 'An error occurred while stopping the network',
+                                       'net-undefine-question' => 'Do you really want to undefine this network?',
+                                       'net-undefine-ok' => 'Network has been successfully undefined',
+                                       'net-undefine-err' => 'An error occurred while undefining the network',
+                                       'net-ip-range-def' => 'Range definition',
+                                       'net-ip-cidr' => 'CIDR (192.168.111.0/24)',
+                                       'net-ip-direct' => 'IP and mask definition',
+                                       'net-ipdef-cidr' => 'CIDR Definition',
                                        'dhcp' => 'DHCP',
-                                       'net_dhcp_start' => 'DHCP Range start',
-                                       'net_dhcp_end' => 'DHCP Range end',
-                                       'net_forward_none' => 'none',
-                                       'net_forward_nat' => 'NAT',
-                                       'net_forward_route' => 'Route',
-                                       'net_forward_dev_empty_msg' => 'Leave empty for forwarding to any device/interface',
-                                       'net_forward_dev_any' => 'any interface / device',
-                                       'net_created' => 'Network has been created successfully',
+                                       'net-dhcp-start' => 'DHCP Range start',
+                                       'net-dhcp-end' => 'DHCP Range end',
+                                       'net-forward-none' => 'none',
+                                       'net-forward-nat' => 'NAT',
+                                       'net-forward-route' => 'Route',
+                                       'net-forward-dev-empty-msg' => 'Leave empty for forwarding to any device/interface',
+                                       'net-forward-dev-any' => 'any interface / device',
+                                       'net-created' => 'Network has been created successfully',
                                        'new-vm-created' => 'New virtual machine has been created successfully',
                                        'network-add-ok' => 'Network card has been successfully added to the guest. Changes will take effect on next domain startup.',
                                        'network-add-error' => 'Cannot add NIC to the guest',
                                        'network-generate-mac' => 'Generate new MAC address',
                                        'network-remove-ok' => 'Network card has been removed successfully. Changes will take effect on next domain startup.',
                                        'network-remove-error' => 'Cannot remove disk',
-                                       'login_page_title' => 'Log-in',
-                                       'login_enter_login' => 'Login:',
-                                       'login_enter_password' => 'Password:',
-                                       'login_submit' => 'Login',
-                                       'login_invalid' => 'Your credentials are not valid. Please provide valid credentials',
+                                       'login-page-title' => 'Log-in',
+                                       'login-enter-login' => 'Login:',
+                                       'login-enter-password' => 'Password:',
+                                       'login-submit' => 'Login',
+                                       'login-invalid' => 'Your credentials are not valid. Please provide valid credentials',
                                        'logout' => 'Logout',
 
                                        'users' => 'Users',
                                        'create-new-user' => 'Create a new user',
-                                       'user_add' => 'Add user',
-                                       'user_edit' => 'Edit user',
-                                       'user_del' => 'Delete user',
-                                       'user_del_confirm' => 'Do you really want to delete selected user?',
-                                       'user_added' => 'User has been successfully added',
-                                       'user_edited' => 'User information has been successfully changed',
-                                       'user_deleted' => 'User has been succesfully deleted',
-                                       'confirm_password' => 'Confirm password',
+                                       'user-add' => 'Add user',
+                                       'user-edit' => 'Edit user',
+                                       'user-del' => 'Delete user',
+                                       'user-del-confirm' => 'Do you really want to delete selected user?',
+                                       'user-added' => 'User has been successfully added',
+                                       'user-edited' => 'User information has been successfully changed',
+                                       'user-deleted' => 'User has been succesfully deleted',
+                                       'confirm-password' => 'Confirm password',
                                        'permissions' => 'Permissions',
-                                       'permission_basic' => 'Basic access',
-                                       'permission_save_connection' => 'Save connection',
-                                       'permission_vm_create' => 'Create virtual machine',
-                                       'permission_vm_edit' => 'Edit virtual machine',
-                                       'permission_vm_delete' => 'Delete virtual machine',
-                                       'permission_network_create' => 'Create virtual network',
-                                       'permission_network_edit' => 'Edit virtual network',
-                                       'permission_network_delete' => 'Delete virtual network',
-                                       'permission_user_create' => 'Create user',
-                                       'permission_user_edit' => 'Edit user',
-                                       'permission_user_delete' => 'Delete user',
-                                       'user_add_btn' => 'Add user',
-                                       'user_edit_btn' => 'Edit user',
-                                       'password_mismatch' => 'Password mismatch',
+                                       'permission-basic' => 'Basic access',
+                                       'permission-save-connection' => 'Save connection',
+                                       'permission-vm-create' => 'Create virtual machine',
+                                       'permission-vm-edit' => 'Edit virtual machine',
+                                       'permission-vm-delete' => 'Delete virtual machine',
+                                       'permission-network-create' => 'Create virtual network',
+                                       'permission-network-edit' => 'Edit virtual network',
+                                       'permission-network-delete' => 'Delete virtual network',
+                                       'permission-user-create' => 'Create user',
+                                       'permission-user-edit' => 'Edit user',
+                                       'permission-user-delete' => 'Delete user',
+                                       'user-add-btn' => 'Add user',
+                                       'user-edit-btn' => 'Edit user',
+                                       'password-mismatch' => 'Password mismatch',
                                        'screenshot-settings-auto-release' => 'Send automatic mouse pointer release event',
                                        'screenshot-delay' => 'Delay has been changed to %d second(s)',
-                                       'cpu_stats' => 'Node CPU stats (one second average)',
-                                       'mem_stats' => 'Node memory stats',
-                                       'system_information' => 'System information',
+                                       'cpu-stats' => 'Node CPU stats (one second average)',
+                                       'mem-stats' => 'Node memory stats',
+                                       'system-information' => 'System information',
                                        'date-format' => 'Y-m-d H:i:s',
                                        'run' => 'Run',
                                        'no-destination-present' => 'No destination present or connected',
                                        'choose-destination' => 'Choose migration destination',
-                                       'dom_migrate' => 'Migrate domain',
-                                       'cpu_stats_per_each_cpu' => 'Node CPU stats per each CPU (one second average)',
+                                       'dom-migrate' => 'Migrate domain',
+                                       'cpu-stats-per-each-cpu' => 'Node CPU stats per each CPU (one second average)',
+                                       'net-none' => 'No network available on the connection',
+                                       'disk-removed' => 'Disk has been removed successfully',
+                                       'disk-not-remove' => 'Disk cannot be removed',
+                                       'disk-added' => 'Disk has been successfully added to the guest',
+                                       'disk-not-added' => 'Cannot add disk to the guest',
+                                       'boot-order-changed' => 'Boot options for next run have been altered successfully',
+                                       'boot-order-change-error' => 'Cannot change guest boot options',
+
+                                       'mem-alloc-changed' => 'Memory allocation for next run has been altered successfully',
+                                       'mem-alloc-change-error' => 'Cannot change memory allocation',
                                        );
 ?>
index dd31b7e..62c552f 100644 (file)
 
   <!-- MENU -->
   <div id="main-menu">
-    <a href="?"><?php echo $lang->get('main_menu') ?></a>
-    | <a href="?page=domain-list"><?php echo $lang->get('domain_list') ?></a>
-    | <a href="?page=network-list"><?php echo $lang->get('network_list') ?></a>
+    <a href="?"><?php echo $lang->get('main-menu') ?></a>
+    | <a href="?page=domain-list"><?php echo $lang->get('domain-list') ?></a>
+    | <a href="?page=network-list"><?php echo $lang->get('network-list') ?></a>
     | <a href="?page=users"><?php echo $lang->get('users') ?></a>
     | <a href="?page=settings"><?php echo $lang->get('settings') ?></a>
     | <a href="?page=info"><?php echo $lang->get('info') ?></a>
     | <a href="?action=logout"><?php echo $lang->get('logout') ?></a>
     <div style="float:right;text-align: right; width:220px;font-size:11px;font-style:italic">
-       <?php if (isset($uri)) echo $lang->get('connected_to').'<br />'.$uri; ?>
+       <?php if (isset($uri)) echo $lang->get('connected-to').'<br />'.$uri; ?>
     </div>
   </div>
index edc9869..a60142c 100644 (file)
@@ -43,8 +43,10 @@ table tr td {
 }
 
 #menu {
-       background-color: lightblue;
        padding: 10px;
+       width: 100%;
+       border: 1px solid grey;
+       margin-bottom: 10px;
 }
 
 #menu a {
index e06b0d8..7be6599 100644 (file)
--- a/menu.php
+++ b/menu.php
@@ -1,18 +1,19 @@
   <!-- MENU -->
+
   <div id="menu">
-  <a href="?name=<?php echo $name ?>"><?php echo $lang->get('menu_overview') ?></a>
+  <a href="?name=<?php echo $name ?>"><?php echo $lang->get('menu-overview') ?></a>
   <!--
-  <br /> <a href="?name=<?php echo $name ?>&amp;page=performance">Performance</a>
+  | <a href="?name=<?php echo $name ?>&amp;page=performance">Performance</a>
   -->
-  <br /> <a href="?name=<?php echo $name ?>&amp;page=processor"><?php echo $lang->get('menu_processor') ?></a>
-  <br /> <a href="?name=<?php echo $name ?>&amp;page=memory"><?php echo $lang->get('menu_memory') ?></a>
-  <br /> <a href="?name=<?php echo $name ?>&amp;page=boot-options"><?php echo $lang->get('menu_boot') ?></a>
-  <br /> <a href="?name=<?php echo $name ?>&amp;page=disk-devices"><?php echo $lang->get('menu_disk') ?></a>
-  <br /> <a href="?name=<?php echo $name ?>&amp;page=network-devices"><?php echo $lang->get('menu_network') ?></a>
-  <br /> <a href="?name=<?php echo $name ?>&amp;page=multimedia-devices"><?php echo $lang->get('menu_multimedia') ?></a>
-  <br /> <a href="?name=<?php echo $name ?>&amp;page=host-devices"><?php echo $lang->get('menu_hostdev') ?></a>
+  | <a href="?name=<?php echo $name ?>&amp;page=processor"><?php echo $lang->get('menu-processor') ?></a>
+  | <a href="?name=<?php echo $name ?>&amp;page=memory"><?php echo $lang->get('menu-memory') ?></a>
+  | <a href="?name=<?php echo $name ?>&amp;page=boot-options"><?php echo $lang->get('menu-boot') ?></a>
+  | <a href="?name=<?php echo $name ?>&amp;page=disk-devices"><?php echo $lang->get('menu-disk') ?></a>
+  | <a href="?name=<?php echo $name ?>&amp;page=network-devices"><?php echo $lang->get('menu-network') ?></a>
+  | <a href="?name=<?php echo $name ?>&amp;page=multimedia-devices"><?php echo $lang->get('menu-multimedia') ?></a>
+  | <a href="?name=<?php echo $name ?>&amp;page=host-devices"><?php echo $lang->get('menu-hostdev') ?></a>
 <?php
-  if (($lv->domain_is_running($res, $name) && ($lv->supports('screenshot'))))
-    echo '<br /> <a href="?name='.$name.'&amp;page=screenshot">'.$lang->get('menu_screenshot').'</a>';
+       if (($lv->domain_is_running($res, $name) && ($lv->supports('screenshot'))))
+               echo '<br /> <a href="?name='.$name.'&amp;page=screenshot">'.$lang->get('menu-screenshot').'</a>';
 ?>
   </div>
index 04e3743..399e3bb 100644 (file)
@@ -1,20 +1,20 @@
-<?
-  if ((array_key_exists('ch-discard', $_POST)) && ($_POST['ch-discard'])) 
-    Die(Header('Location: '.$_SERVER['REQUEST_URI']));
+<?php
+       if ((array_key_exists('ch-discard', $_POST)) && ($_POST['ch-discard']))
+               Die(Header('Location: '.$_SERVER['REQUEST_URI']));
 
-  $bd1 = array_key_exists('bd_1st', $_POST) ? $_POST['bd_1st'] : false;
-  $bd2 = array_key_exists('bd_2nd', $_POST) ? $_POST['bd_2nd'] : false;
+       $bd1 = array_key_exists('bd_1st', $_POST) ? $_POST['bd_1st'] : false;
+       $bd2 = array_key_exists('bd_2nd', $_POST) ? $_POST['bd_2nd'] : false;
 
-  $msg = '';
-  if ($bd1) {
-    $msg = $lv->domain_change_boot_devices($name, $bd1, $bd2) ? 'Boot options for next run have been altered successfully'
-           : 'Cannot change guest boot options: '.$lv->get_last_error();
-  }
+       $msg = '';
+       if ($bd1) {
+               $msg = $lv->domain_change_boot_devices($name, $bd1, $bd2) ? $lang->get('boot-order-changed') :
+                       $lang->get('boot-order-change-error').': '.$lv->get_last_error();
+       }
 
-  $devs = $lv->domain_get_boot_devices($res);
-  $bd_1st = $devs[0];
-  $bd_2nd = (sizeof($devs) > 1) ? $devs[1] : '-';
-  unset($devs);
+       $devs = $lv->domain_get_boot_devices($res);
+       $bd_1st = $devs[0];
+       $bd_2nd = (sizeof($devs) > 1) ? $devs[1] : '-';
+       unset($devs);
 ?>
   <!-- CONTENTS -->
   <div id="content">
         }
         function check() {
             if (change_el == 'ch-apply')
-                return (confirm('<?php echo $lang->get('ask_apply') ?>'));
+                return (confirm('<?php echo $lang->get('ask-apply') ?>'));
             if (change_el == 'ch-discard')
-                return (confirm('<?php echo $lang->get('ask_discard') ?>'));
+                return (confirm('<?php echo $lang->get('ask-discard') ?>'));
         }
     -->
     </script>
 
 <?php
-    if ($msg):
+       if ($msg):
 ?>
     <div id="msg"><b><?php echo $lang->get('msg') ?>: </b><?php echo $msg ?></div>
 <?php
-    endif;
+       endif;
 ?>
 
     <form action="#" method="POST" onsubmit="return check();">
 
     <!-- HOST SECTION -->
-    <div class="section"><?php echo $lang->get('vm_boot_opts') ?></div>
+    <div class="section"><?php echo $lang->get('vm-boot-opts') ?></div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_boot_dev1') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-boot-dev1') ?>:</div>
       <div class="value">
         <select name="bd_1st">
-          <option value="hd" <?php echo (($bd_1st == 'hd') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm_boot_hdd') ?></option>
-          <option value="cdrom" <?php echo (($bd_1st == 'cdrom') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm_boot_cd') ?></option>
-          <option value="fd" <?php echo (($bd_1st == 'fd') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm_boot_fda') ?></option>
-          <option value="network" <?php echo (($bd_1st == 'network') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm_boot_pxe') ?></option>
+          <option value="hd" <?php echo (($bd_1st == 'hd') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm-boot-hdd') ?></option>
+          <option value="cdrom" <?php echo (($bd_1st == 'cdrom') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm-boot-cd') ?></option>
+          <option value="fd" <?php echo (($bd_1st == 'fd') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm-boot-fda') ?></option>
+          <option value="network" <?php echo (($bd_1st == 'network') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm-boot-pxe') ?></option>
         </select>
       </div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_boot_dev2') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-boot-dev2') ?>:</div>
       <div class="value">
         <select name="bd_2nd">
-          <option value="-" <?php echo (($bd_2nd == '-') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm_boot_none') ?></option>
-          <option value="hd" <?php echo (($bd_2nd == 'hd') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm_boot_hdd') ?></option>
-          <option value="cdrom" <?php echo (($bd_2nd == 'cdrom') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm_boot_cd') ?></option>
-          <option value="fd" <?php echo (($bd_2nd == 'fd') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm_boot_fda') ?></option>
-          <option value="network" <?php echo (($bd_2nd == 'network') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm_boot_pxe') ?></option>
+          <option value="-" <?php echo (($bd_2nd == '-') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm-boot-none') ?></option>
+          <option value="hd" <?php echo (($bd_2nd == 'hd') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm-boot-hdd') ?></option>
+          <option value="cdrom" <?php echo (($bd_2nd == 'cdrom') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm-boot-cd') ?></option>
+          <option value="fd" <?php echo (($bd_2nd == 'fd') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm-boot-fda') ?></option>
+          <option value="network" <?php echo (($bd_2nd == 'network') ? 'selected="selected"' : '') ?>><?php echo $lang->get('vm-boot-pxe') ?></option>
         </select>
       </div>
       <div class="nl" />
@@ -78,8 +78,8 @@
     <div class="item">
       <div class="label"><?php echo $lang->get('changes') ?>:</div>
       <div class="value">
-        <input type="submit" name="ch-apply" value=" <?php echo $lang->get('btn_apply') ?> " onclick="setElement('change', this)" />
-        <input type="submit" name="ch-discard" value=" <?php echo $lang->get('btn_discard') ?> " onclick="setElement('change', this)" />
+        <input type="submit" name="ch-apply" value=" <?php echo $lang->get('btn-apply') ?> " onclick="setElement('change', this)" />
+        <input type="submit" name="ch-discard" value=" <?php echo $lang->get('btn-discard') ?> " onclick="setElement('change', this)" />
       </div>
       <div class="nl" />
     </div>
index 492fdf8..3127b61 100644 (file)
@@ -1,29 +1,29 @@
 <?php
-  $disk = array_key_exists('disk', $_GET) ? $_GET['disk'] : false;
-  $action = array_key_exists('action', $_GET) ? $_GET['action'] : false;
+       $disk = array_key_exists('disk', $_GET) ? $_GET['disk'] : false;
+       $action = array_key_exists('action', $_GET) ? $_GET['action'] : false;
 
-  $msg = '';
-  $frm = '';
-  if (($action == 'del-disk') && ($disk)) {
-    $msg = $lv->domain_disk_remove($name, $disk) ? 'Disk has been removed successfully' : 'Cannot remove disk: '.$lv->get_last_error();
-  }
-  if ($action == 'add-disk') {
-    $img = array_key_exists('img', $_POST) ? $_POST['img'] : false;
+       $msg = '';
+       $frm = '';
+       if (($action == 'del-disk') && ($disk)) {
+               $msg = $lv->domain_disk_remove($name, $disk) ? $lang->get('disk-removed') : $lang->get('disk-not-removed').': '.$lv->get_last_error();
+       }
 
-    if ($img)
-        $msg = $lv->domain_disk_add($name, $_POST['img'], $_POST['dev'], $_POST['bus'], $_POST['driver']) ?
-                                    'Disk has been successfully added to the guest' :
-                                    'Cannot add disk to the guest: '.$lv->get_last_error();
-    else
-        $frm = '<div class="section">'.$lang->get('vm_disk_add').'</div>
+       if ($action == 'add-disk') {
+               $img = array_key_exists('img', $_POST) ? $_POST['img'] : false;
+
+       if ($img)
+               $msg = $lv->domain_disk_add($name, $_POST['img'], $_POST['dev'], $_POST['bus'], $_POST['driver']) ?
+                               $lang->get('disk-added') : ($lang->get('disk-not-added').': '.$lv->get_last_error());
+       else
+               $frm = '<div class="section">'.$lang->get('vm-disk-add').'</div>
                 <form method="POST">
                 <table id="form-table">
                   <tr>
-                    <td align="right"><b>'.$lang->get('vm_disk_image').': </b></td>
+                    <td align="right"><b>'.$lang->get('vm-disk-image').': </b></td>
                     <td><input type="text" name="img" /></td>
                   </tr>
                  <tr>
-                   <td align="right"><b>'.$lang->get('vm_disk_location').': </b></td>
+                   <td align="right"><b>'.$lang->get('vm-disk-location').': </b></td>
                    <td>
                       <select name="bus">
                         <option value="ide">IDE Bus</option>
@@ -32,7 +32,7 @@
                     </td>
                  </tr>
                   <tr>
-                    <td align="right"><b>'.$lang->get('vm_disk_type').': </b></td>
+                    <td align="right"><b>'.$lang->get('vm-disk-type').': </b></td>
                     <td>
                       <select name="driver">
                         <option value="raw">raw</option>
                     </td>
                   </tr>
                   <tr>
-                    <td align="right"><b>'.$lang->get('vm_disk_dev').': </b></td>
+                    <td align="right"><b>'.$lang->get('vm-disk-dev').': </b></td>
                     <td><input type="text" name="dev" value="hdb" /></td>
                   </tr>
                   <tr align="center">
-                    <td colspan="2"><input type="submit" value=" '.$lang->get('vm_disk_add').' " /></td>
+                    <td colspan="2"><input type="submit" value=" '.$lang->get('vm-disk-add').' " /></td>
                   </tr>
                 </table>
                 </form>';
-  }
+       }
 
-  $tmp = $lv->get_disk_stats($name);
-  $tmp2 = $lv->get_cdrom_stats($name, true);
-  $numDisks = sizeof($tmp);
+       $tmp = $lv->get_disk_stats($name);
+       $tmp2 = $lv->get_cdrom_stats($name, true);
+       $numDisks = sizeof($tmp);
 
-  $addmsg = (sizeof($tmp2) > 0) ? ' (disk) + '.(sizeof($tmp2)).' (cdrom)' : '';
+       $addmsg = (sizeof($tmp2) > 0) ? ' (disk) + '.(sizeof($tmp2)).' (cdrom)' : '';
 ?>
   <!-- CONTENTS -->
   <div id="content">
     <script language="javascript">
     <!--
         function confirmAddition() {
-            if (confirm('<?php echo $lang->get('vm_disk_askadd') ?>')) {
+            if (confirm('<?php echo $lang->get('vm-disk-askadd') ?>')) {
                 location.href = '?name=<?php echo $name.'&page='.$page ?>&action=add-disk';
             }
         }
         function askDiskDeletion(disk) {
-            if (confirm('<?php echo $lang->get('vm_disk_askdel') ?>'))
+            if (confirm('<?php echo $lang->get('vm-disk-askdel') ?>'))
                 location.href = '?name=<?php echo $name.'&page='.$page.'&action=del-disk&disk=' ?>'+disk;
         }
     -->
 
     <form action="#" method="POST">
 
-    <div class="section"><?php echo $lang->get('vm_disk_details') ?></div>
+    <div class="section"><?php echo $lang->get('vm-disk-details') ?></div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_disk_num') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-disk-num') ?>:</div>
       <div class="value"><?php echo $numDisks.$addmsg ?></div>
       <div class="nl" />
     </div>
 
 <?php
-    for ($i = 0; $i < sizeof($tmp); $i++):
-      $disk = $tmp[$i];
-      $bus = ($disk['bus'] == 'ide') ? 'IDE' : 'SCSI';
+       for ($i = 0; $i < sizeof($tmp); $i++):
+               $disk = $tmp[$i];
+               $bus = ($disk['bus'] == 'ide') ? 'IDE' : 'SCSI';
 ?>
     <!-- DISK SECTION -->
     <div class="section"><?php echo $bus ?> Disk <?php echo $i + 1 ?></div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_disk_storage') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-disk-storage') ?>:</div>
       <div class="value"><?php echo $disk['file'] ?></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_disk_type') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-disk-type') ?>:</div>
       <div class="value"><?php echo $disk['type'] ?></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_disk_dev') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-disk-dev') ?>:</div>
       <div class="value"><?php echo $disk['device'] ?></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_disk_capacity') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-disk-capacity') ?>:</div>
       <div class="value"><?php echo $lv->format_size($disk['capacity'], 2) ?></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_disk_allocation') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-disk-allocation') ?>:</div>
       <div class="value"><?php echo $lv->format_size($disk['allocation'], 2) ?></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_disk_physical') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-disk-physical') ?>:</div>
       <div class="value"><?php echo $lv->format_size($disk['physical'], 2) ?></div>
       <div class="nl" />
     </div>
     <div class="item">
       <div class="label"><?php echo $lang->get('actions') ?>:</div>
       <div class="value">
-        <input type="button" onclick="askDiskDeletion('<?php echo $disk['device'] ?>')" value=" <?php echo $lang->get('vm_disk_remove') ?> " />
+        <input type="button" onclick="askDiskDeletion('<?php echo $disk['device'] ?>')" value=" <?php echo $lang->get('vm-disk-remove') ?> " />
       </div>
       <div class="nl" />
     </div>
-<?
-    endfor;
-?>
-
 <?php
-    for ($i = 0; $i < sizeof($tmp2); $i++):
-      $disk = $tmp2[$i];
-      $bus = ($disk['bus'] == 'ide') ? 'IDE' : 'SCSI';
+       endfor;
+
+       for ($i = 0; $i < sizeof($tmp2); $i++):
+               $disk = $tmp2[$i];
+               $bus = ($disk['bus'] == 'ide') ? 'IDE' : 'SCSI';
 ?>
     <!-- DISK SECTION -->
     <div class="section"><?php echo $bus ?> CD-ROM <?php echo $i + 1 ?></div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_disk_storage') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-disk-storage') ?>:</div>
       <div class="value"><?php echo $disk['file'] ?></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_disk_type') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-disk-type') ?>:</div>
       <div class="value"><?php echo $disk['type'] ?></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_disk_dev') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-disk-dev') ?>:</div>
       <div class="value"><?php echo $disk['device'] ?></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_disk_capacity') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-disk-capacity') ?>:</div>
       <div class="value"><?php echo $lv->format_size($disk['capacity'], 2) ?></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_disk_allocation') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-disk-allocation') ?>:</div>
       <div class="value"><?php echo $lv->format_size($disk['allocation'], 2) ?></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_disk_physical') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-disk-physical') ?>:</div>
       <div class="value"><?php echo $lv->format_size($disk['physical'], 2) ?></div>
       <div class="nl" />
     </div>
     <div class="item">
       <div class="label"><?php echo $lang->get('actions') ?>:</div>
       <div class="value">
-        <input type="button" onclick="askDiskDeletion('<?php echo $disk['device'] ?>')" value=" <?php echo $lang->get('vm_disk_remove') ?> " />
+        <input type="button" onclick="askDiskDeletion('<?php echo $disk['device'] ?>')" value=" <?php echo $lang->get('vm-disk-remove') ?> " />
       </div>
       <div class="nl" />
     </div>
 
 <?php
-    endfor;
-    unset($tmp);
-    unset($tmp2);
+       endfor;
+       unset($tmp);
+       unset($tmp2);
 ?>
 
     <!-- ACTIONS SECTION -->
     <div class="item">
       <div class="label"><?php echo $lang->get('changes') ?>:</div>
       <div class="value">
-        <input type="button" name="add-disk" value=" <?php echo $lang->get('vm_disk_add') ?> " onclick="confirmAddition()" />
+        <input type="button" name="add-disk" value=" <?php echo $lang->get('vm-disk-add') ?> " onclick="confirmAddition()" />
       </div>
       <div class="nl" />
     </div>
index 0076cf0..56397f8 100644 (file)
@@ -1,15 +1,15 @@
 <?php
-  $devs = $lv->domain_get_host_devices($name);
+       $devs = $lv->domain_get_host_devices($name);
 ?>
   <!-- CONTENTS -->
   <div id="content">
 
     <form action="#" method="POST">
 
-    <div class="section"><?php echo $lang->get('host_devices_title') ?></div>
+    <div class="section"><?php echo $lang->get('host-devices-title') ?></div>
 
 <?php
-    for ($i = 0; $i < sizeof($devs['pci']); $i++):
+       for ($i = 0; $i < sizeof($devs['pci']); $i++):
 ?>
     <div class="item">
       <div class="label">PCI Device #<?php echo $i+1 ?>:</div>
       <div class="nl" />
     </div>
 <?php
-    endfor;
+       endfor;
 ?>
 
 <?php
-    for ($i = 0; $i < sizeof($devs['usb']); $i++):
+       for ($i = 0; $i < sizeof($devs['usb']); $i++):
 ?>
     <div class="item">
       <div class="label">USB Device #<?php echo $i+1 ?>:</div>
       <div class="nl" />
     </div>
 <?php
-    endfor;
+       endfor;
 ?>
 
 <?php
-    if (sizeof($devs['usb']) + sizeof($devs['pci']) == 0):
+       if (sizeof($devs['usb']) + sizeof($devs['pci']) == 0):
 ?>
     <div class="item">
-      <div class="label"><?php echo $lang->get('host_devices') ?>:</div>
-      <div class="value"><?php echo $lang->get('hostdev_none') ?></div>
+      <div class="label"><?php echo $lang->get('host-devices') ?>:</div>
+      <div class="value"><?php echo $lang->get('hostdev-none') ?></div>
       <div class="nl" />
     </div>
-<?
+<?php
     endif;
 ?>
 
@@ -49,7 +49,7 @@
     <div class="item">
       <div class="label"><?php echo $lang->get('changes') ?>:</div>
       <div class="value">
-        <?php echo $lang->get('details_readonly') ?>
+        <?php echo $lang->get('details-readonly') ?>
       </div>
       <div class="nl" />
     </div>
index 3ef416d..181508f 100644 (file)
@@ -1,24 +1,24 @@
 <?php
-  if ((array_key_exists('ch-discard', $_POST)) && ($_POST['ch-discard'])) 
-    Die(Header('Location: '.$_SERVER['REQUEST_URI']));
+       if ((array_key_exists('ch-discard', $_POST)) && ($_POST['ch-discard']))
+               Die(Header('Location: '.$_SERVER['REQUEST_URI']));
 
-  $ci  = $lv->host_get_node_info();
-  $memory = round($ci['memory'] / 1024);
-  unset($ci);
+       $ci  = $lv->host_get_node_info();
+       $memory = round($ci['memory'] / 1024);
+       unset($ci);
 
-  $pmemory = array_key_exists('memory', $_POST) ? $_POST['memory'] : false;
-  $pmaxmem = array_key_exists('maxmem', $_POST) ? $_POST['maxmem'] : false;
+       $pmemory = array_key_exists('memory', $_POST) ? $_POST['memory'] : false;
+       $pmaxmem = array_key_exists('maxmem', $_POST) ? $_POST['maxmem'] : false;
 
-  $msg = '';
-  if ($pmemory && $pmaxmem) {
-    $msg = $lv->domain_change_memory_allocation($name, $pmemory, $pmaxmem) ? 'Memory allocation for next run has been altered successfully'
-           : 'Cannot change guest memory allocation: '.$lv->get_last_error();
-  }
+       $msg = '';
+       if ($pmemory && $pmaxmem) {
+               $msg = $lv->domain_change_memory_allocation($name, $pmemory, $pmaxmem) ? $lang->get('mem-alloc-changed') :
+                               $lang->get('mem-alloc-change-error').': '.$lv->get_last_error();
+       }
 
-  $info = $lv->domain_get_info($name);
-  $guest_memory = round($info['memory'] / 1024);
-  $guest_maxmem = round($info['maxMem'] / 1024);
-  unset($info);
+       $info = $lv->domain_get_info($name);
+       $guest_memory = round($info['memory'] / 1024);
+       $guest_maxmem = round($info['maxMem'] / 1024);
+       unset($info);
 ?>
   <!-- CONTENTS -->
   <div id="content">
         }
         function check() {
             if (change_el == 'ch-apply')
-                return (confirm('<?php echo $lang->get('ask_apply') ?>'));
+                return (confirm('<?php echo $lang->get('ask-apply') ?>'));
             if (change_el == 'ch-discard')
-                return (confirm('<?php echo $lang->get('ask_discard') ?>'));
+                return (confirm('<?php echo $lang->get('ask-discard') ?>'));
         }
     -->
     </script>
 
 <?php
-    if ($msg):
+       if ($msg):
 ?>
     <div id="msg"><b><?php echo $lang->get('msg') ?>: </b><?php echo $msg ?></div>
 <?php
-    endif;
+       endif;
 ?>
 
     <form action="#" method="POST" onsubmit="return check();">
 
     <!-- HOST SECTION -->
-    <div class="section"><?php echo $lang->get('host_mem_info') ?></div>
+    <div class="section"><?php echo $lang->get('host-mem-info') ?></div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('total_mem') ?>:</div>
+      <div class="label"><?php echo $lang->get('total-mem') ?>:</div>
       <div class="value"><?php echo $memory ?> MiB</div>
       <div class="nl" />
     </div>
     <!-- MACHINE SECTION -->
-    <div class="section"><?php echo $lang->get('vm_mem_info') ?> (MiBs)</div>
+    <div class="section"><?php echo $lang->get('vm-mem-info') ?> (MiBs)</div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('mem_alloc_cur') ?>:</div>
+      <div class="label"><?php echo $lang->get('mem-alloc-cur') ?>:</div>
       <div class="value">
         <input type="text" name="memory" value="<?php echo $guest_memory ?>" />
       </div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('mem_alloc_max') ?>:</div>
+      <div class="label"><?php echo $lang->get('mem-alloc-max') ?>:</div>
       <div class="value">
         <input type="text" name="maxmem" value="<?php echo $guest_maxmem ?>" />
       </div>
@@ -78,8 +78,8 @@
     <div class="item">
       <div class="label"><?php echo $lang->get('changes') ?>:</div>
       <div class="value">
-        <input type="submit" name="ch-apply" value=" <?php echo $lang->get('btn_apply') ?> " onclick="setElement('change', this)" />
-        <input type="submit" name="ch-discard" value=" <?php echo $lang->get('btn_discard') ?> " onclick="setElement('change', this)" />
+        <input type="submit" name="ch-apply" value=" <?php echo $lang->get('btn-apply') ?> " onclick="setElement('change', this)" />
+        <input type="submit" name="ch-discard" value=" <?php echo $lang->get('btn-discard') ?> " onclick="setElement('change', this)" />
       </div>
       <div class="nl" />
     </div>
index cb631df..fa12394 100644 (file)
@@ -3,27 +3,27 @@
 
     <form action="#" method="POST">
 
-    <div class="section"><?php echo $lang->get('vm_multimedia_title') ?></div>
+    <div class="section"><?php echo $lang->get('vm-multimedia-title') ?></div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_multimedia_console') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-multimedia-console') ?>:</div>
       <div class="value"><?php echo $lv->domain_get_multimedia_device($res, 'console', true) ?></div>
       <div class="nl" />
     </div>
 
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_multimedia_input') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-multimedia-input') ?>:</div>
       <div class="value"><?php echo $lv->domain_get_multimedia_device($res, 'input', true) ?></div>
       <div class="nl" />
     </div>
 
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_multimedia_graphics') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-multimedia-graphics') ?>:</div>
       <div class="value"><?php echo $lv->domain_get_multimedia_device($res, 'graphics', true) ?></div>
       <div class="nl" />
     </div>
 
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_multimedia_video') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-multimedia-video') ?>:</div>
       <div class="value"><?php echo $lv->domain_get_multimedia_device($res, 'video', true) ?></div>
       <div class="nl" />
     </div>
@@ -33,7 +33,7 @@
     <div class="item">
       <div class="label"><?php echo $lang->get('changes') ?>:</div>
       <div class="value">
-        <?php echo $lang->get('details_readonly') ?>
+        <?php echo $lang->get('details-readonly') ?>
       </div>
       <div class="nl" />
     </div>
index f64ad44..1fce04a 100644 (file)
@@ -1,63 +1,64 @@
 <?php
-  $dev = array_key_exists('dev', $_GET) ? $_GET['dev'] : false;
-  $action = array_key_exists('action', $_GET) ? $_GET['action'] : false;
-
-  $msg = '';
-  $frm = '';
-  if (($action == 'del-nic') && ($dev)) {
-    $msg = $lv->domain_nic_remove($name, base64_decode($dev)) ? $lang->get('network-remove-ok') :
-                               $lang->get('network-remove-error').': '.$lv->get_last_error();
-  }
-  if ($action == 'add-nic') {
-    if (array_key_exists('mac', $_POST))
-        $msg = $lv->domain_nic_add($name, $_POST['mac'], $_POST['network'], $_POST['nic_type']) ?
-                                       $lang->get('network-add-ok') : $lang->get('network-add-error').': '.$lv->get_last_error();
-    else {
-       $nets = $lv->get_networks();
-       $models = $lv->get_nic_models();
-
-        $frm = '<div class="section">'.$lang->get('vm_network_add').'</div>
-                <form method="POST">
-                <table id="form-table">
-                  <tr>
-                    <td align="right"><b>'.$lang->get('vm_network_mac').': </b></td>
-                    <td><input type="text" name="mac" value="'.$lv->generate_random_mac_addr().'"/></td>
-                  </tr>
-                 <tr>
-                   <td align="right"><b>'.$lang->get('vm_network_net').': </b></td>
-                   <td>
-                      <select name="network">';
-
-       for ($i = 0; $i < sizeof($nets); $i++)
-               $frm .= '<option value="'.$nets[$i].'">'.$nets[$i].'</option>';
-
-       $frm .= '    </select>
-                    </td>
-                 </tr>
-                  <tr>
-                    <td align="right"><b>'.$lang->get('vm_network_type').': </b></td>
-                    <td>
-                      <select name="nic_type">';
-
-       for ($i = 0; $i < sizeof($models); $i++)
-               $frm .= '<option value="'.$models[$i].'">'.$models[$i].'</option>';
-
-       $frm .= '
-                      </select>
-                    </td>
-                  </tr>
-                  <tr align="center">
-                    <td colspan="2"><input type="submit" value=" '.$lang->get('vm_network_add').' " /></td>
-                  </tr>
-                </table>
-                </form>';
-    }
-  }
-
-  $tmp = $lv->get_nic_info($name);
-  $numDisks = sizeof($tmp);
-  if (!$tmp)
-    $numDisks = 0;
+       $dev = array_key_exists('dev', $_GET) ? $_GET['dev'] : false;
+       $action = array_key_exists('action', $_GET) ? $_GET['action'] : false;
+
+       $msg = '';
+       $frm = '';
+       if (($action == 'del-nic') && ($dev)) {
+               $msg = $lv->domain_nic_remove($name, base64_decode($dev)) ? $lang->get('network-remove-ok') :
+                       $lang->get('network-remove-error').': '.$lv->get_last_error();
+       }
+
+       if ($action == 'add-nic') {
+               if (array_key_exists('mac', $_POST))
+                       $msg = $lv->domain_nic_add($name, $_POST['mac'], $_POST['network'], $_POST['nic_type']) ?
+                               $lang->get('network-add-ok') : $lang->get('network-add-error').': '.$lv->get_last_error();
+               else {
+                       $nets = $lv->get_networks();
+                       $models = $lv->get_nic_models();
+
+                       $frm = '<div class="section">'.$lang->get('vm-network-add').'</div>
+                               <form method="POST">
+                               <table id="form-table">
+                               <tr>
+                                       <td align="right"><b>'.$lang->get('vm-network-mac').': </b></td>
+                                       <td><input type="text" name="mac" value="'.$lv->generate_random_mac_addr().'"/></td>
+                               </tr>
+                               <tr>
+                                       <td align="right"><b>'.$lang->get('vm-network-net').': </b></td>
+                                       <td>
+                                       <select name="network">';
+
+                       for ($i = 0; $i < sizeof($nets); $i++)
+                               $frm .= '<option value="'.$nets[$i].'">'.$nets[$i].'</option>';
+
+                       $frm .= '    </select>
+                                       </td>
+                                       </tr>
+                                       <tr>
+                                               <td align="right"><b>'.$lang->get('vm-network-type').': </b></td>
+                                               <td>
+                                                       <select name="nic_type">';
+
+                       for ($i = 0; $i < sizeof($models); $i++)
+                               $frm .= '<option value="'.$models[$i].'">'.$models[$i].'</option>';
+
+                       $frm .= '
+                                                       </select>
+                                               </td>
+                                       </tr>
+                                       <tr align="center">
+                                               <td colspan="2"><input type="submit" value=" '.$lang->get('vm-network-add').' " /></td>
+                                       </tr>
+                               </table>
+                               </form>';
+               }
+       }
+
+       $tmp = $lv->get_nic_info($name);
+       $numDisks = sizeof($tmp);
+       if (!$tmp)
+               $numDisks = 0;
 ?>
   <!-- CONTENTS -->
   <div id="content">
     <script language="javascript">
     <!--
         function confirmAddition() {
-            if (confirm('<?php echo $lang->get('vm_network_askadd') ?>')) {
+            if (confirm('<?php echo $lang->get('vm-network-askadd') ?>')) {
                 location.href = '?name=<?php echo $name.'&page='.$page ?>&action=add-nic';
             }
         }
         function askNicDeletion(mac, macb64) {
-            if (confirm('<?php echo $lang->get('vm_network_askdel') ?>'))
+            if (confirm('<?php echo $lang->get('vm-network-askdel') ?>'))
                 location.href = '?name=<?php echo $name.'&page='.$page.'&action=del-nic&dev=' ?>'+macb64;
         }
     -->
     </script>
 
 <?php
-    if ($msg):
+       if ($msg):
 ?>
     <div id="msg"><b>Message: </b><?php echo $msg ?></div>
 <?php
-    endif;
+       endif;
 ?>
 <?php
-    if ($frm):
+       if ($frm):
 ?>
     <div><?php echo $frm ?></div>
 <?php
-    endif;
+       endif;
 ?>
 
     <form action="#" method="POST">
 
-    <div class="section"><?php echo $lang->get('vm_network_title') ?></div>
+    <div class="section"><?php echo $lang->get('vm-network-title') ?></div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_network_num') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-network-num') ?>:</div>
       <div class="value"><?php echo $numDisks ?></div>
       <div class="nl" />
     </div>
 
 <?php
-    if (!$tmp)
-       $tmp = array();
+       if (!$tmp)
+               $tmp = array();
 
-    for ($i = 0; $i < sizeof($tmp); $i++):
-        $nic = $tmp[$i];
+       for ($i = 0; $i < sizeof($tmp); $i++):
+               $nic = $tmp[$i];
 ?>
     <!-- NIC SECTION -->
-    <div class="section"><?php echo $lang->get('vm_network_nic') ?> #<?php echo $i + 1 ?></div>
+    <div class="section"><?php echo $lang->get('vm-network-nic') ?> #<?php echo $i + 1 ?></div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_network_mac') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-network-mac') ?>:</div>
       <div class="value"><?php echo $nic['mac'] ?></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_network_net') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-network-net') ?>:</div>
       <div class="value"><?php echo $nic['network'] ?></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('vm_network_type') ?>:</div>
+      <div class="label"><?php echo $lang->get('vm-network-type') ?>:</div>
       <div class="value"><?php echo $nic['nic_type'] ?></div>
       <div class="nl" />
     </div>
     <div class="item">
       <div class="label"><?php echo $lang->get('actions') ?>:</div>
       <div class="value">
-        <input type="button" onclick="askNicDeletion('<?php echo $nic['mac'] ?>', '<?php echo base64_encode($nic['mac']) ?>')" value=" <?php echo $lang->get('vm_network_del') ?> " />
+        <input type="button" onclick="askNicDeletion('<?php echo $nic['mac'] ?>', '<?php echo base64_encode($nic['mac']) ?>')" value=" <?php echo $lang->get('vm-network-del') ?> " />
       </div>
       <div class="nl" />
     </div>
-<?
-    endfor;
-    unset($tmp);
+<?php
+       endfor;
+       unset($tmp);
 ?>
 
     <!-- ACTIONS SECTION -->
     <div class="item">
       <div class="label"><?php echo $lang->get('changes') ?>:</div>
       <div class="value">
-        <input type="button" name="add-nic" value=" <?php echo $lang->get('vm_network_add') ?> " onclick="confirmAddition()" />
+        <input type="button" name="add-nic" value=" <?php echo $lang->get('vm-network-add') ?> " onclick="confirmAddition()" />
       </div>
       <div class="nl" />
     </div>
index 4d91d51..d27f44e 100644 (file)
@@ -39,9 +39,9 @@
         }
         function check() {
             if (change_el == 'ch-apply')
-                return (confirm('<?php echo $lang->get('ask_apply') ?>'));
+                return (confirm('<?php echo $lang->get('ask-apply') ?>'));
             if (change_el == 'ch-discard')
-                return (confirm('<?php echo $lang->get('ask_discard') ?>'));
+                return (confirm('<?php echo $lang->get('ask-discard') ?>'));
         }
     -->
     </script>
@@ -73,7 +73,7 @@
       <div class="nl" />
     </div>
     <!-- MACHINE DETAILS SECTION -->
-    <div class="section"><?php echo $lang->get('vm_details') ?>: </div>
+    <div class="section"><?php echo $lang->get('vm-details') ?>: </div>
     <div class="item">
       <div class="label"><?php echo $lang->get('arch') ?>:</div>
       <div class="value"><?php echo $arch ?></div>
     <div class="item">
       <div class="label"><?php echo $lang->get('changes') ?>:</div>
       <div class="value">
-        <input type="submit" name="ch-apply" value=" <?php echo $lang->get('btn_apply') ?> " onclick="setElement('change', this)" />
-        <input type="submit" name="ch-discard" value=" <?php echo $lang->get('btn_discard') ?> " onclick="setElement('change', this)" />
+        <input type="submit" name="ch-apply" value=" <?php echo $lang->get('btn-apply') ?> " onclick="setElement('change', this)" />
+        <input type="submit" name="ch-discard" value=" <?php echo $lang->get('btn-discard') ?> " onclick="setElement('change', this)" />
       </div>
       <div class="nl" />
     </div>
index 73c4149..5e43026 100644 (file)
@@ -1,23 +1,24 @@
 <?php
-  if ((array_key_exists('ch-discard', $_POST)) && ($_POST['ch-discard']))
-       Die(Header('Location: '.$_SERVER['REQUEST_URI']));
+       if ((array_key_exists('ch-discard', $_POST)) && ($_POST['ch-discard']))
+               Die(Header('Location: '.$_SERVER['REQUEST_URI']));
 
-  $ci  = $lv->get_connect_information();
-  $max = $ci['hypervisor_maxvcpus'];
-  unset($ci);
+       $ci  = $lv->get_connect_information();
+       $max = $ci['hypervisor_maxvcpus'];
+       unset($ci);
 
-  $msg = '';
-  $cpus = array_key_exists('cpu_count', $_POST) ? $_POST['cpu_count'] : false;
-  if ($cpus) {
-    $msg = $lv->domain_change_numVCpus($name, $cpus) ? 'Number of VCPUs for next run has been altered successfully'
-           : 'Cannot change guest VCPU count: '.$lv->get_last_error();
-  }
-  $info = $lv->domain_get_info($name);
-  $guest_cpu_count = $info['nrVirtCpu'];
-  unset($info);
-  $ci  = $lv->host_get_node_info();
-  $cpus = $ci['cpus'];
-  unset($ci);
+       $msg = '';
+       $cpus = array_key_exists('cpu_count', $_POST) ? $_POST['cpu_count'] : false;
+       if ($cpus) {
+               $msg = $lv->domain_change_numVCpus($name, $cpus) ? 'Number of VCPUs for next run has been altered successfully' :
+                       'Cannot change guest VCPU count: '.$lv->get_last_error();
+       }
+
+       $info = $lv->domain_get_info($name);
+       $guest_cpu_count = $info['nrVirtCpu'];
+       unset($info);
+       $ci  = $lv->host_get_node_info();
+       $cpus = $ci['cpus'];
+       unset($ci);
 ?>
   <!-- CONTENTS -->
   <div id="content">
         }
         function check() {
             if (change_el == 'ch-apply')
-                return (confirm('<?php echo $lang->get('ask_apply') ?>'));
+                return (confirm('<?php echo $lang->get('ask-apply') ?>'));
             if (change_el == 'ch-discard')
-                return (confirm('<?php echo $lang->get('ask_discard') ?>'));
+                return (confirm('<?php echo $lang->get('ask-discard') ?>'));
         }
     -->
     </script>
 
 <?php
-    if ($msg):
+       if ($msg):
 ?>
     <div id="msg"><b><?php echo $lang->get('msg') ?>: </b><?php echo $msg ?></div>
 <?php
-    endif;
+       endif;
 ?>
 
     <form action="#" method="POST" onsubmit="return check();">
 
     <!-- HOST SECTION -->
-    <div class="section"><?php echo $lang->get('host_pcpu_info') ?></div>
+    <div class="section"><?php echo $lang->get('host-pcpu-info') ?></div>
     <div class="item">
       <div class="label"><?php echo $lang->get('pcpus') ?>:</div>
       <div class="value"><?php echo $cpus ?></div>
       <div class="nl" />
     </div>
     <div class="item">
-      <div class="label"><?php echo $lang->get('max_per_guest') ?>:</div>
+      <div class="label"><?php echo $lang->get('max-per-guest') ?>:</div>
       <div class="value"><?php echo $max ?> vCPUs</div>
       <div class="nl" />
     </div>
     <!-- MACHINE SECTION -->
-    <div class="section"><?php echo $lang->get('vm_vcpu_info') ?></div>
+    <div class="section"><?php echo $lang->get('vm-vcpu-info') ?></div>
     <div class="item">
       <div class="label"><?php echo $lang->get('vcpus') ?>:</div>
       <div class="value">
         <select name="cpu_count">
-<?
-        for ($i = 1; $i <= $max; $i++)
-            echo '<option value='.$i.' '.($i == $guest_cpu_count ? 'selected="selected"' : '').'>'.$i.'</option>';
+<?php
+       for ($i = 1; $i <= $max; $i++)
+               echo '<option value='.$i.' '.($i == $guest_cpu_count ? 'selected="selected"' : '').'>'.$i.'</option>';
 ?>
         </select>
       </div>
@@ -80,8 +81,8 @@
     <div class="item">
       <div class="label"><?php echo $lang->get('changes') ?>:</div>
       <div class="value">
-        <input type="submit" name="ch-apply" value=" <?php echo $lang->get('btn_apply') ?> " onclick="setElement('change', this)" />
-        <input type="submit" name="ch-discard" value=" <?php echo $lang->get('btn_discard') ?> " onclick="setElement('change', this)" />
+        <input type="submit" name="ch-apply" value=" <?php echo $lang->get('btn-apply') ?> " onclick="setElement('change', this)" />
+        <input type="submit" name="ch-discard" value=" <?php echo $lang->get('btn-discard') ?> " onclick="setElement('change', this)" />
       </div>
       <div class="nl" />
     </div>
index 02f1039..7c4b6bc 100644 (file)
@@ -1,77 +1,76 @@
 <?php
-  define('MOUSE_POINTER_DEBUG', false);
-
-  if (array_key_exists('get-dims', $_GET)) {
-    ob_end_clean();
-    $tmp = $lv->domain_get_screen_dimensions($name);
-    if (!$tmp)
-        die( 'Error occured while getting screen dimensions '.$lv->get_last_error() );
-
-    die('ok: '.$tmp['width'].'x'.$tmp['height']);
-  }
-
-  if (array_key_exists('x', $_GET)) {
-    ob_end_clean();
-    $tmp = $lv->domain_send_pointer_event($name, $_GET['x'], $_GET['y'], (int)$_GET['bm'], $_GET['autorelease'] ? true : false);
-    if (!$tmp)
-       die( 'Error occured while sending pointer event: '.$lv->get_last_error() );
-
-    //die( $_GET['x'].','.$_GET['y'] );
-    die('ok');
-  }
-  if (array_key_exists('send_keys', $_GET)) {
-    ob_end_clean();
-    $tmp = $lv->domain_send_keys($name, $_GET['send_keys']);
-    if (!$tmp)
-        die( 'Error occured while sending keys: '.$lv->get_last_error() );
-
-    die('ok');
-  }
-
-  $interval = array_key_exists('interval', $_POST) ? $_POST['interval'] : 1;
-  $msg = '';
-  if (!$lv->domain_is_running($name))
-    $msg = 'Domain is not running';
-  if (!$lv->supports('screenshot'))
-    $msg = 'Host machine doesn\'t support getting domain screenshots';
-
- function error($w, $h, $msg) {
-    $im = imagecreatetruecolor($w, $h);
-    $text_color = imagecolorallocate($im, 233, 14, 11);
-    imagestring($im, 5, 5, 20, 'We are sorry!', $text_color);
-
-    $arr = explode("\n", $msg);
-    for ($i = 0; $i < sizeof($arr); $i++) {
-      imagestring($im, 5, 5, 50 + ($i * 20), $arr[$i], $text_color);
-    }
-
-    imagepng($im);
-    imagedestroy($im);
- }
-
-  if (array_key_exists('data', $_GET) && ($_GET['data'] == 'png')) {
-    ob_end_clean();
-    $tmp = $lv->domain_get_screenshot($name);
-    Header('Content-Type: image/png');
-    if (!$tmp)
-        error(240, 130, "Cannot get the domain\nscreenshot for domain\nrequested.");
-    else
-        echo $tmp;
-
-    exit;
-  }
+       define('MOUSE_POINTER_DEBUG', false);
+
+       if (array_key_exists('get-dims', $_GET)) {
+               ob_end_clean();
+               $tmp = $lv->domain_get_screen_dimensions($name);
+               if (!$tmp)
+                       die( 'Error occured while getting screen dimensions '.$lv->get_last_error() );
+
+               die('ok: '.$tmp['width'].'x'.$tmp['height']);
+       }
+
+       if (array_key_exists('x', $_GET)) {
+               ob_end_clean();
+               $tmp = $lv->domain_send_pointer_event($name, $_GET['x'], $_GET['y'], (int)$_GET['bm'], $_GET['autorelease'] ? true : false);
+               if (!$tmp)
+                       die( 'Error occured while sending pointer event: '.$lv->get_last_error() );
+
+               //die( $_GET['x'].','.$_GET['y'] );
+               die('ok');
+       }
+
+       if (array_key_exists('send_keys', $_GET)) {
+               ob_end_clean();
+               $tmp = $lv->domain_send_keys($name, $_GET['send_keys']);
+               if (!$tmp)
+                       die( 'Error occured while sending keys: '.$lv->get_last_error() );
+
+               die('ok');
+       }
+
+       $interval = array_key_exists('interval', $_POST) ? $_POST['interval'] : 1;
+       $msg = '';
+       if (!$lv->domain_is_running($name))
+               $msg = 'Domain is not running';
+       if (!$lv->supports('screenshot'))
+               $msg = 'Host machine doesn\'t support getting domain screenshots';
+
+       function error($w, $h, $msg) {
+               $im = imagecreatetruecolor($w, $h);
+               $text_color = imagecolorallocate($im, 233, 14, 11);
+               imagestring($im, 5, 5, 20, 'We are sorry!', $text_color);
+
+               $arr = explode("\n", $msg);
+               for ($i = 0; $i < sizeof($arr); $i++)
+                       imagestring($im, 5, 5, 50 + ($i * 20), $arr[$i], $text_color);
+
+               imagepng($im);
+               imagedestroy($im);
+       }
+
+       if (array_key_exists('data', $_GET) && ($_GET['data'] == 'png')) {
+               ob_end_clean();
+               $tmp = $lv->domain_get_screenshot($name);
+               Header('Content-Type: image/png');
+               if (!$tmp)
+                       error(240, 130, "Cannot get the domain\nscreenshot for domain\nrequested.");
+               else
+                       echo $tmp;
+               exit;
+       }
 ?>
   <!-- CONTENTS -->
   <div id="content">
 
 <?php
-    if ($msg):
+       if ($msg):
 ?>
-    <div class="section"><?php echo $lang->get('dom_screenshot') ?></div>
+    <div class="section"><?php echo $lang->get('dom-screenshot') ?></div>
     <div id="msg"><b><?php echo $lang->get('msg') ?>: </b><?php echo $msg ?></div>
 <?php
-    else:
-       $dims = $lv->domain_get_screen_dimensions($name);
+       else:
+               $dims = $lv->domain_get_screen_dimensions($name);
 ?>
 
 <div id="ajax-msg"></div>
@@ -82,7 +81,7 @@
         delay = <?php echo $interval * 1000 ?>;
 
 <?php
-    if (ALLOW_EXPERIMENTAL_VNC):
+       if (ALLOW_EXPERIMENTAL_VNC):
 ?>
        var IE = document.all ? true : false;
        if (!IE) document.captureEvents(Event.MOUSEMOVE || Event.CLICK)
index 1bf29b7..fa64d41 100644 (file)
 <?php
-  $action = array_key_exists('action', $_GET) ? $_GET['action'] : false;
-  $msg = '';
-  $frm = '';
-  if ($action == 'domain-start') {
-    $name = $_GET['dom'];
-    $msg = $lv->domain_start($name) ? $lang->get('dom_start_ok') :
-           $lang->get('dom_start_err').': '.$lv->get_last_error();
-  }
+       $action = array_key_exists('action', $_GET) ? $_GET['action'] : false;
 
-  if ($action == 'domain-stop') {
-    $name = $_GET['dom'];
-    $msg = $lv->domain_shutdown($name) ? $lang->get('dom_shutdown_ok') :
-           $lang->get('dom_shutdown_err').': '.$lv->get_last_error();
-  }
+       $lvDomain = new LibvirtDomain($lv, $lang, $action, $_GET);
+       $lvDomainData = $lvDomain->getData();
 
-  if ($action == 'domain-destroy') {
-    $name = $_GET['dom'];
-    $msg = $lv->domain_destroy($name) ? $lang->get('dom_destroy_ok') :
-           $lang->get('dom_destroy_err').': '.$lv->get_last_error();
-  }
-
-  if (($action == 'domain-undefine') && (verify_user($db, USER_PERMISSION_VM_DELETE))) {
-    $name = $_GET['dom'];
-    if ((!array_key_exists('confirmed', $_GET)) || ($_GET['confirmed'] != 1)) {
-        $frm = '<div class="section">'.$lang->get('dom_undefine').'</div>
-                <table id="form-table">
-                <tr>
-                  <td colspan="3">'.$lang->get('dom_undefine_question').' '.$lang->get('name').': <u>'.$name.'</u></td>
-                </tr>
-                <tr align="center">
-                  <td><a href="'.$_SERVER['REQUEST_URI'].'&amp;confirmed=1">'.$lang->get('delete').'</a></td>
-                  <td><a href="'.$_SERVER['REQUEST_URI'].'&amp;confirmed=1&amp;deldisks=1">'.$lang->get('delete_with_disks').'</a></td>
-                  <td><a href="?page='.$page.'">'.$lang->get('No').'</a></td>
-                </td>
-                </table>';
-    }
-    else {
-       $err = '';
-       if (array_key_exists('deldisks', $_GET) && $_GET['deldisks'] == 1) {
-               $disks = $lv->get_disk_stats($name);
-
-               for ($i = 0; $i < sizeof($disks); $i++) {
-                       $img = $disks[$i]['file'];
-
-                       if (!$lv->remove_image($img, array(2) ))
-                               $err .= $img.': '.$lv->get_last_error();
-               }
+       if (is_array($lvDomainData)) {
+               $msg = $lvDomainData['msg'];
+               $frm = $lvDomainData['frm'];
+               $xml = $lvDomainData['xml'];
        }
-        $msg = $lv->domain_undefine($name) ? $lang->get('dom_undefine_ok') :
-               $lang->get('dom_undefine_err').': '.$lv->get_last_error();
-
-       if ($err)
-               $msg .= ' (err: '.$err.')';
-    }
-  }
-
-  if ($action == 'domain-dump') {
-    $name = $_GET['dom'];
-
-    $inactive = (!$lv->domain_is_running($name)) ? true : false;
-
-    $xml = $lv->domain_get_xml($name, $inactive);
-    $frm = '<div class="section">'.$lang->get('dom_xmldesc').' - <i>'.$name.'</i></div><form method="POST">
-            <table id="form-table"><tr><td>'.$lang->get('dom_xmldesc').': </td>
-            <td><textarea readonly="readonly" name="xmldesc" rows="25" cols="90%">'.$xml.'</textarea></td></tr><tr align="center"><td colspan="2">
-            </tr></form></table>';
-  }
-
-  if ($action == 'domain-migrate') {
-    $name = $_GET['dom'];
-
-    if (!array_key_exists('dest-uri', $_POST)) {
-       $uris = array();
-
-       foreach ($conns as $conn) {
-               if ($conn['connection_uri'] != $uri)
-                       $uris[] = array(
-                                       'id' => $conn['id'],
-                                       'name' => $conn['connection_name']
-                                       );
-       }
-
-       if (sizeof($uris) == 0)
-               echo $lang->get('no-destination-present');
-       else {
-               echo "<form method='POST'>".$lang->get('choose-destination')." ($name): <br /><select name='dest-uri' style='width: 150px'>";
-
-               foreach ($uris as $cn)
-                       echo "<option value=\"${cn['id']}\">{$cn['name']}</option>";
-
-               echo "</select><br /><input type='submit' value='".$lang->get('dom_migrate')."'>";
-       }
-    }
-    else {
-       $arr = false;
-
-       for ($i = 0; $i < sizeof($conns); $i++) {
-               if ($conns[$i]['id'] == $_POST['dest-uri']) {
-                       $arr = $conns[$i];
-                       break;
-               }
-       }
-
-        if ($arr && (!$lv->migrate($name, $arr)))
-               echo '<b>'.$lang->get('error_page_title').'</b>: '.$lv->get_last_error();
-    }
-  }
-
-  if ($action == 'domain-edit') {
-    $name = $_GET['dom'];
-
-    $inactive = (!$lv->domain_is_running($name)) ? true : false;
-
-    if (array_key_exists('xmldesc', $_POST)) {
-        $msg = $lv->domain_change_xml($name, $_POST['xmldesc']) ? $lang->get('dom_define_changed') :
-               $lang->get('dom_define_change_err').': '.$lv->get_last_error();
-
-    }
-    else {
-        $xml = $lv->domain_get_xml($name, $inactive);
-        $frm = '<div class="section">'.$lang->get('dom_editxml').' - <i>'.$name.'</i></div><form method="POST"><table id="form-table"><tr><td>'.$lang->get('dom_xmldesc').': </td>
-             <td><textarea name="xmldesc" rows="25" cols="90%">'.$xml.'</textarea></td></tr><tr align="center"><td colspan="2">
-             <input type="submit" value=" '.$lang->get('dom_editxml').' "></tr></form></table>';
-    }
-  }
+       else
+               $msg = $frm = $xml = false;
 ?>
 <div id="content">
 
 <?php
-    if ($msg):
+       if ($msg):
 ?>
-    <div id="msg"><b><?php echo $lang->get('msg') ?>: </b><?php echo $msg ?></div>
+       <div id="msg"><b><?php echo $lang->get('msg') ?>: </b><?php echo $msg ?></div>
 <?php
-    endif;
+       endif;
 ?>
 
 <?php
-    if ($frm)
-       echo $frm;
+       if ($frm)
+               echo $frm;
 ?>
 
-<div class="section"><?php echo $lang->get('domain_list') ?></div>
+<div class="section"><?php echo $lang->get('domain-list') ?></div>
 
 <?php
-        if (verify_user($db, USER_PERMISSION_VM_CREATE)):
-?>
-<?php
-        endif;
+       if (verify_user($db, USER_PERMISSION_VM_CREATE)):
 ?>
-
 <div style="padding: 10px; font-size: 14px; font-weight: bold; width: 100%; border: 1px solid grey;margin-bottom: 10px;">
 <a href="?page=new-vm"><?php echo $lang->get('create-new-vm') ?></a>
 </div>
+<?php
+       endif;
+?>
 
 <table id="domain-list">
   <tr>
                                        $nics = 0;
                                if (($diskcnt = $lv->get_disk_count($res)) > 0) {
                                        $disks = $diskcnt.' / '.$lv->get_disk_capacity($res);
-                                       $diskdesc = $lang->get('cur_phys_size').': '.$lv->get_disk_capacity($res, true);
+                                       $diskdesc = $lang->get('cur-phys-size').': '.$lv->get_disk_capacity($res, true);
                                }
                                else {
                                        $disks = $lang->get('diskless');
 
                                $running = $lv->domain_is_running($res, $name);
                                if (!$running) {
-                                       $actions  = '<a href="?page='.$page.'&amp;action=domain-start&amp;dom='.$name.'"><img src="graphics/play.png" title="'.$lang->get('dom_start').'" /></a> ';
-                                       $actions .= '<a href="?page='.$page.'&amp;action=domain-dump&amp;dom='.$name.'"><img src="graphics/dump.png" title="'.$lang->get('dom_dumpxml').'" /></a> ';
+                                       $actions  = '<a href="?page='.$page.'&amp;action=domain-start&amp;dom='.$name.'"><img src="graphics/play.png" title="'.$lang->get('dom-start').'" /></a> ';
+                                       $actions .= '<a href="?page='.$page.'&amp;action=domain-dump&amp;dom='.$name.'"><img src="graphics/dump.png" title="'.$lang->get('dom-dumpxml').'" /></a> ';
                                        if (verify_user($db, USER_PERMISSION_VM_EDIT))
-                                               $actions .= '<a href="?page='.$page.'&amp;action=domain-edit&amp;dom='.$name.'"><img src="graphics/edit.png" title="'.$lang->get('dom_editxml').'" /></a> ';
+                                               $actions .= '<a href="?page='.$page.'&amp;action=domain-edit&amp;dom='.$name.'"><img src="graphics/edit.png" title="'.$lang->get('dom-editxml').'" /></a> ';
                                        if (verify_user($db, USER_PERMISSION_VM_DELETE))
-                                               $actions .= '<a href="?page='.$page.'&amp;action=domain-undefine&amp;dom='.$name.'"><img src="graphics/undefine.png" title="'.$lang->get('dom_undefine').'" /></a> ';
+                                               $actions .= '<a href="?page='.$page.'&amp;action=domain-undefine&amp;dom='.$name.'"><img src="graphics/undefine.png" title="'.$lang->get('dom-undefine').'" /></a> ';
 
                                        $actions[ strlen($actions) - 2 ] = ' ';
                                        $actions = Trim($actions);
                                }
                                else {
-                                       $actions  = '<a href="?page='.$page.'&amp;action=domain-stop&amp;dom='.$name.'"><img src="graphics/stop.png" title="'.$lang->get('dom_stop').'" /></a> ';
-                                       $actions .= '<a href="?page='.$page.'&amp;action=domain-destroy&amp;dom='.$name.'"><img src="graphics/destroy.png" title="'.$lang->get('dom_destroy').'" /></a> ';
-                                       $actions .= '<a href="?page='.$page.'&amp;action=domain-dump&amp;dom='.$name.'"><img src="graphics/dump.png" title="'.$lang->get('dom_dumpxml').'" /></a> ';
-                                       $actions .= '<a href="?page='.$page.'&amp;action=domain-migrate&amp;dom='.$name.'"><img src="graphics/migrate.png" title="'.$lang->get('dom_migrate').'" /></a> ';
+                                       $actions  = '<a href="?page='.$page.'&amp;action=domain-stop&amp;dom='.$name.'"><img src="graphics/stop.png" title="'.$lang->get('dom-stop').'" /></a> ';
+                                       $actions .= '<a href="?page='.$page.'&amp;action=domain-destroy&amp;dom='.$name.'"><img src="graphics/destroy.png" title="'.$lang->get('dom-destroy').'" /></a> ';
+                                       $actions .= '<a href="?page='.$page.'&amp;action=domain-dump&amp;dom='.$name.'"><img src="graphics/dump.png" title="'.$lang->get('dom-dumpxml').'" /></a> ';
+                                       $actions .= '<a href="?page='.$page.'&amp;action=domain-migrate&amp;dom='.$name.'"><img src="graphics/migrate.png" title="'.$lang->get('dom-migrate').'" /></a> ';
 
                                        if ($lv->supports('screenshot'))
-                                               $actions .= '<a href="?name='.$name.'&amp;page=screenshot"><img src="graphics/screenshot.png" title="'.$lang->get('dom_screenshot').'" /></a>';
+                                               $actions .= '<a href="?name='.$name.'&amp;page=screenshot"><img src="graphics/screenshot.png" title="'.$lang->get('dom-screenshot').'" /></a>';
 
                                        $actions[ strlen($actions) - 2 ] = ' ';
                                        $actions = Trim($actions);
                }
 
                if ($num == 0)
-                       echo "<tr><td colspan=\"9\">".$lang->get('dom_none')."</td></tr>";
+                       echo "<tr><td colspan=\"9\">".$lang->get('dom-none')."</td></tr>";
        ?>
 </table>
 
index 69fbeb2..75ed8af 100644 (file)
@@ -1,41 +1,17 @@
 <?php
-       ob_start();
-       PHPInfo();
-       $c = ob_get_contents();
-       ob_end_clean();
-
-       $c = substr($c, strpos($c, 'module_libvirt'));
-        $c = substr($c, strpos($c, 'h2') + 3);
-
-       $p = strpos($c, 'module') - 3;
-       $out = substr($c, 0, $p);
-
-        $out = str_replace('<tr>', '<div class="item">', $out);
-       $out = str_replace('<td class="e">', '<div class="label">', $out);
-       $out = str_replace('</td><td class="v">', '</div><div class="value">', $out);
-       $out = str_replace('</td></tr>', '</div><div class="nl" /></div>', $out);
-
-       $tmp = explode("\n", $out);
-       $start_el = false;
-       $last_el = false;
-       for ($i = 0; $i < sizeof($tmp); $i++) {
-               if (strpos('.'.$tmp[$i], '</table'))
-                       $last_el = $i;
-               if (strpos('.'.$tmp[$i], '<table'))
-                       $start_el = $i + 1;
-       }
-
-       $tmp2 = array();
-       for ($i = $start_el; $i < $last_el; $i++)
-               $tmp2[] = $tmp[$i];
-       unset($tmp);
-
-       $out = join("\n", $tmp2);
+       $lvInfo = new LibvirtInfo($lv, $lang);
+       $moduleInfo = $lvInfo->getModuleInfo();
+       $connectInfo = $lvInfo->getConnectInfo();
+       $nodeInfo = $lvInfo->getNodeInfo();
+       $cpuStats = $lvInfo->getCpuStats();
+       $cpuStatsEach = $lvInfo->getCpuStatsEachCPU();
+       $memStats = $lvInfo->getMemoryStats();
+       $sysInfo = $lvInfo->getSystemInfo();
 ?>
 
 <div id="content">
 
-<div class="section"><?php echo $lang->get('title_vmc').' '.$lang->get('for_php') ?></div>
+<div class="section"><?php echo $lang->get('title-vmc').' '.$lang->get('for-php') ?></div>
 
 <div class="item">
         <div class="label"><?php echo $lang->get('version') ?></div>
         <div class="nl">
 </div>
 
-<div class="section"><?php echo $lang->get('conn_details') ?></div>
-
-<?php
-       $tmp  = $lv->get_connect_information();
-?>
+<div class="section"><?php echo $lang->get('conn-details') ?></div>
 
 <div class="item">
         <div class="label"><?php echo $lang->get('hypervisor') ?></div>
-        <div class="value"><?php echo (array_key_exists('hypervisor_string', $tmp) ? $tmp['hypervisor_string'] : '<i>'.$lang->get('error').'</i>' ) ?></div>
+        <div class="value"><?php echo (array_key_exists('hypervisor_string', $tmp) ? $connectInfo['hypervisor_string'] : '<i>'.$lang->get('error').'</i>' ) ?></div>
         <div class="nl">
 </div>
 
 <div class="item">
-        <div class="label"><?php echo $lang->get('conn_uri') ?></div>
-        <div class="value"><?php echo $tmp['uri'] ?></div>
+        <div class="label"><?php echo $lang->get('conn-uri') ?></div>
+        <div class="value"><?php echo $connectInfo['uri'] ?></div>
         <div class="nl">
 </div>
 
 <div class="item">
         <div class="label"><?php echo $lang->get('hostname') ?></div>
-        <div class="value"><?php echo $tmp['hostname'] ?></div>
+        <div class="value"><?php echo $connectInfo['hostname'] ?></div>
         <div class="nl">
 </div>
 
 <div class="item">
-        <div class="label"><?php echo $lang->get('conn_encrypted') ?></div>
-        <div class="value"><?php echo $lang->get($tmp['encrypted']) ?></div>
+        <div class="label"><?php echo $lang->get('conn-encrypted') ?></div>
+        <div class="value"><?php echo $lang->get($connectInfo['encrypted']) ?></div>
         <div class="nl">
 </div>
 
 <div class="item">
-        <div class="label"><?php echo $lang->get('conn_secure') ?></div>
-        <div class="value"><?php echo $lang->get($tmp['secure']) ?></div>
+        <div class="label"><?php echo $lang->get('conn-secure') ?></div>
+        <div class="value"><?php echo $lang->get($connectInfo['secure']) ?></div>
         <div class="nl">
 </div>
 
 <div class="item">
-        <div class="label"><?php echo $lang->get('hypervisor_limit') ?></div>
-        <div class="value"><?php echo $tmp['hypervisor_maxvcpus'] ?> vCPUs per guest</div>
+        <div class="label"><?php echo $lang->get('hypervisor-limit') ?></div>
+        <div class="value"><?php echo $connectInfo['hypervisor_maxvcpus'] ?> vCPUs per guest</div>
         <div class="nl">
 </div>
 
-<?php
-       unset($tmp);
-       $tmp = $lv->host_get_node_info();
-?>
-<div class="section"><?php echo $lang->get('host_details') ?></div>
+<div class="section"><?php echo $lang->get('host-details') ?></div>
 <div class="item">
        <div class="label"><?php echo $lang->get('model') ?></div>
-       <div class="value"><?php echo $tmp['model'] ?></div>
+       <div class="value"><?php echo $nodeInfo['model'] ?></div>
        <div class="nl">
 </div>
 
 <div class="item">
         <div class="label"><?php echo $lang->get('mem') ?></div>
-        <div class="value"><?php echo (int)($tmp['memory'] / 1024) ?> MiB</div>
+        <div class="value"><?php echo (int)($nodeInfo['memory'] / 1024) ?> MiB</div>
         <div class="nl">
 </div>
 
 <div class="item">
         <div class="label"><?php echo $lang->get('pcpus') ?></div>
-        <div class="value"><?php echo $tmp['cpus'].' ('.$tmp['nodes'].' nodes, '.$tmp['sockets'].' sockets, '.$tmp['cores'].' cores)' ?></div>
+        <div class="value"><?php echo $nodeInfo['cpus'].' ('.$nodeInfo['nodes'].' nodes, '.$nodeInfo['sockets'].' sockets, '.$nodeInfo['cores'].' cores)' ?></div>
         <div class="nl">
 </div>
 
 <div class="item">
-        <div class="label"><?php echo $lang->get('cpu_speed') ?></div>
-        <div class="value"><?php echo $tmp['mhz'] ?> MHz</div>
+        <div class="label"><?php echo $lang->get('cpu-speed') ?></div>
+        <div class="value"><?php echo $nodeInfo['mhz'] ?> MHz</div>
         <div class="nl">
 </div>
 <?php unset($tmp) ?>
 <div class="section"><?php echo $lang->get('modinfo') ?></div>
-<?php echo $out ?>
+<?php echo $moduleInfo ?>
 </div>
 
-<div class="section"><?php echo $lang->get('cpu_stats'); ?></div>
+<div class="section"><?php echo $lang->get('cpu-stats'); ?></div>
 <?php
-$tmp = $lv->node_get_cpu_stats();
-$numCpus = $tmp['cpus'];
-if (is_array($tmp)) foreach ($tmp as $name => $value) {
-    echo '<div class="label">'.$name.'</div>';
-    echo '<div class="value">'.$value.'</div><div class="nl">';
-}
+       $numCpus = $cpuStats['cpus'];
+       if (is_array($cpuStats)) foreach ($cpuStats as $name => $value) {
+               echo '<div class="label">'.$name.'</div>';
+               echo '<div class="value">'.$value.'</div><div class="nl">';
+       }
 ?>
 <br />
-<div class="section"><?php echo $lang->get('cpu_stats_per_each_cpu'); ?></div>
+<div class="section"><?php echo $lang->get('cpu-stats-per-each-cpu'); ?></div>
 <?php
-    $tmp = $lv->node_get_cpu_stats_each_cpu(2);
-    foreach ($tmp as $k => $value) {
-        echo '<div class="label">CPU #'.$k.'</div>';
-        echo '<div class="value">';
-        foreach ($value as $key => $val) {
-            if ($key != 'time')
-                echo '<div class="label">'.$key.'</div><div class="value" style="text-align: right">'.$val.'</div>';
-        }
-
-        echo '</div><br />';
-    }
+       foreach ($cpuStatsEach as $k => $value) {
+               echo '<div class="label">CPU #'.$k.'</div>';
+               echo '<div class="value">';
+               foreach ($value as $key => $val) {
+                       if ($key != 'time')
+                               echo '<div class="label">'.$key.'</div><div class="value" style="text-align: right">'.$val.'</div>';
+               }
+
+               echo '</div><br />';
+       }
 ?>
 <div style="clear:both"></div>
-<div class="section"><?php echo $lang->get('mem_stats'); ?></div>
+<div class="section"><?php echo $lang->get('mem-stats'); ?></div>
 <?php
-$tmp = $lv->node_get_mem_stats();
-if (is_array($tmp)) foreach ($tmp as $name => $value) {
-    echo '<div class="label">'.$name.'</div>';
-
-    if ($name != 'time')
-        echo '<div class="value">'.round($value / 1024).' MiB</div><div class="nl">';
-    else
-        echo '<div class="value">'.@Date($lang->get('date-format'), $value).'</div><div class="nl">';
-}
+       if (is_array($memStats)) foreach ($memStats as $name => $value) {
+               echo '<div class="label">'.$name.'</div>';
+
+               if ($name != 'time')
+                       echo '<div class="value">'.round($value / 1024).' MiB</div><div class="nl">';
+               else
+                       echo '<div class="value">'.@Date($lang->get('date-format'), $value).'</div><div class="nl">';
+       }
 ?>
 <br />
 <div style="clear:both"></div>
-<div class="section"><?php echo $lang->get('system_information'); ?></div>
+<div class="section"><?php echo $lang->get('system-information'); ?></div>
 <pre>
 <?php
-    $tmp = $lv->connect_get_sysinfo();
-    echo htmlentities($tmp);
+       echo htmlentities($sysInfo);
 ?>
 </pre>
+<?php
+       unset($lvInfo);
+       unset($moduleInfo);
+       unset($connectInfo);
+       unset($nodeInfo);
+       unset($cpuStats);
+       unset($cpuStatsEach);
+       unset($memStats);
+       unset($sysInfo);
+?>
index f4e7bae..60cf16d 100644 (file)
@@ -1,68 +1,16 @@
 <?php
-  $action = array_key_exists('action', $_GET) ? $_GET['action'] : false;
-
-  $frm = '';
-  $msg = '';
-
-  if ($action == 'net-start') {
-    $name = $_GET['net'];
-
-    $msg = $lv->set_network_active($name, true) ? $lang->get('net_start_ok') :
-          $lang->get('net_start_err').': '.$lv->get_last_error();
-  }
-
-  if ($action == 'net-stop') {
-    $name = $_GET['net'];
-
-    $msg = $lv->set_network_active($name, false) ? $lang->get('net_stop_ok') :
-           $lang->get('net_stop_err').': '.$lv->get_last_error();
-  }
-
-  if (($action == 'net-undefine') && (verify_user($db, USER_PERMISSION_NETWORK_CREATE))){
-    $name = $_GET['net'];
-    if ((!array_key_exists('confirmed', $_GET)) || ($_GET['confirmed'] != 1)) {
-        $frm = '<div class="section">'.$lang->get('net_undefine').'</div>
-                <table id="form-table">
-                <tr>
-                  <td colspan="3">'.$lang->get('net_undefine_question').' '.$lang->get('name').': <u>'.$name.'</u></td>
-                </tr>
-                <tr align="center">
-                  <td><a href="'.$_SERVER['REQUEST_URI'].'&amp;confirmed=1">'.$lang->get('Yes').'</a></td>
-                  <td><a href="?page='.$page.'">'.$lang->get('No').'</a></td>
-                </td>
-                </table>';
-    }
-    else {
-        $msg = $lv->network_undefine($name) ? $lang->get('net_undefine_ok') :
-               $lang->get('net_undefine_err').': '.$lv->get_last_error();
-    }
-  }
-
-  if ($action == 'net-dumpxml') {
-    $name = $_GET['net'];
-
-    $xml = $lv->network_get_xml($name);
-    $frm = '<div class="section">'.$lang->get('net_xmldesc').' - <i>'.$name.'</i></div><form method="POST">
-            <table id="form-table"><tr><td>'.$lang->get('net_xmldesc').': </td>
-            <td><textarea readonly="readonly" name="xmldesc" rows="25" cols="90%">'.$xml.'</textarea></td></tr><tr align="center"><td colspan="2">
-            </tr></form></table>';
-  }
-
-  if (($action == 'net-editxml') && (verify_user($db, USER_PERMISSION_NETWORK_EDIT))) {
-    $name = $_GET['net'];
-
-    if (array_key_exists('xmldesc', $_POST)) {
-        $msg = $lv->network_change_xml($name, $_POST['xmldesc']) ? $lang->get('net_define_changed') :
-               $lang->get('net_define_change_err').': '.$lv->get_last_error();
-
-    }
-    else {
-        $xml = $lv->network_get_xml($name);
-        $frm = '<div class="section">'.$lang->get('net_editxml').' - <i>'.$name.'</i></div><form method="POST"><table id="form-table"><tr><td>'.$lang->get('net_xmldesc').': </td>
-             <td><textarea name="xmldesc" rows="25" cols="90%">'.$xml.'</textarea></td></tr><tr align="center"><td colspan="2">
-             <input type="submit" value=" '.$lang->get('net_editxml').' "></tr></form></table>';
-    }
-  }
+       $action = array_key_exists('action', $_GET) ? $_GET['action'] : false;
+
+       $lvNetwork = new LibvirtNetwork($lv, $lang, $action, $_GET);
+       $lvNetworkData = $lvNetwork->getData();
+
+       if ($lvNetworkData) {
+               $frm = $lvNetworkData['frm'];
+               $msg  = $lvNetworkData['msg'];
+               $xml = $lvNetworkData['xml'];
+       }
+       else
+               $frm = $msg = $xml = false;
 ?>
 <div id="content">
 
        echo $frm;
 ?>
 
-<div class="section"><?php echo $lang->get('network_list') ?></div>
+<div class="section"><?php echo $lang->get('network-list') ?></div>
 
-<table id="domain-list">
 <?php
        if (verify_user($db, USER_PERMISSION_NETWORK_CREATE)):
 ?>
-  <tr>
-    <td colspan="2" align="left">
-      <a href="?page=new-net"><?php echo $lang->get('create-new-network') ?></a>
-    </td>
-  </tr>
+<div style="padding: 10px; font-size: 14px; font-weight: bold; width: 100%; border: 1px solid grey;margin-bottom: 10px;">
+<a href="?page=new-net"><?php echo $lang->get('create-new-network') ?></a>
+</div>
 <?php
        endif;
 ?>
+
+<table id="domain-list">
   <tr>
     <th><?php echo $lang->get('name') ?></th>
-    <th><?php echo $lang->get('net_ip') ?></th>
-    <th><?php echo $lang->get('net_mask') ?></th>
-    <th><?php echo $lang->get('net_range') ?></th>
-    <th><?php echo $lang->get('net_forward') ?></th>
-    <th><?php echo $lang->get('net_dev') ?></th>
-    <th><?php echo $lang->get('net_dhcp_range') ?></th>
-    <th><?php echo $lang->get('net_active') ?></th>
+    <th><?php echo $lang->get('net-ip') ?></th>
+    <th><?php echo $lang->get('net-mask') ?></th>
+    <th><?php echo $lang->get('net-range') ?></th>
+    <th><?php echo $lang->get('net-forward') ?></th>
+    <th><?php echo $lang->get('net-dev') ?></th>
+    <th><?php echo $lang->get('net-dhcp-range') ?></th>
+    <th><?php echo $lang->get('net-active') ?></th>
     <th><?php echo $lang->get('actions') ?></th>
   </tr>
 <?php
                                $active_str = $lang->get( $active ? 'Yes' : 'No' );
 
                                if ($dev == 'any interface')
-                                       $dev = $lang->get('net_forward_dev_any');
+                                       $dev = $lang->get('net-forward-dev-any');
 
                                $actions = '';
                                if (!$active) {
-                                       $actions .= '<a href="?page='.$page.'&amp;action=net-start&amp;net='.$name.'"><img src="graphics/play.png" title="'.$lang->get('net_start').'" /></a> ';
-                                       $actions .= '<a href="?page='.$page.'&amp;action=net-dumpxml&amp;net='.$name.'"><img src="graphics/dump.png" title="'.$lang->get('net_dumpxml').'" /></a> ';
+                                       $actions .= '<a href="?page='.$page.'&amp;action=net-start&amp;net='.$name.'"><img src="graphics/play.png" title="'.$lang->get('net-start').'" /></a> ';
+                                       $actions .= '<a href="?page='.$page.'&amp;action=net-dumpxml&amp;net='.$name.'"><img src="graphics/dump.png" title="'.$lang->get('net-dumpxml').'" /></a> ';
                                        if (verify_user($db, USER_PERMISSION_NETWORK_EDIT))
-                                               $actions .= '<a href="?page='.$page.'&amp;action=net-editxml&amp;net='.$name.'"><img src="graphics/edit.png" title="'.$lang->get('net_editxml').'" /></a> ';
+                                               $actions .= '<a href="?page='.$page.'&amp;action=net-editxml&amp;net='.$name.'"><img src="graphics/edit.png" title="'.$lang->get('net-editxml').'" /></a> ';
                                        if (verify_user($db, USER_PERMISSION_NETWORK_DELETE))
-                                               $actions .= '<a href="?page='.$page.'&amp;action=net-undefine&amp;net='.$name.'"><img src="graphics/undefine.png" title="'.$lang->get('net_undefine').'" /></a> ';
+                                               $actions .= '<a href="?page='.$page.'&amp;action=net-undefine&amp;net='.$name.'"><img src="graphics/undefine.png" title="'.$lang->get('net-undefine').'" /></a> ';
 
                                        $actions[ strlen($actions) - 2 ] = ' ';
                                        $actions = Trim($actions);
                                }
                                else {
-                                       $actions  = '<a href="?page='.$page.'&amp;action=net-stop&amp;net='.$name.'"><img src="graphics/stop.png" title="'.$lang->get('net_stop').'" /></a> ';
-                                       $actions .= '<a href="?page='.$page.'&amp;action=net-dumpxml&amp;net='.$name.'"><img src="graphics/dump.png" title="'.$lang->get('net_dumpxml').'" /></a> ';
+                                       $actions  = '<a href="?page='.$page.'&amp;action=net-stop&amp;net='.$name.'"><img src="graphics/stop.png" title="'.$lang->get('net-stop').'" /></a> ';
+                                       $actions .= '<a href="?page='.$page.'&amp;action=net-dumpxml&amp;net='.$name.'"><img src="graphics/dump.png" title="'.$lang->get('net-dumpxml').'" /></a> ';
 
                                        $actions[ strlen($actions) - 2 ] = ' ';
                                        $actions = Trim($actions);
                }
 
                if ($num == 0)
-                       echo "<tr><td colspan=\"9\">".$lang->get('dom_none')."</td></tr>";
+                       echo "<tr><td colspan=\"9\">".$lang->get('net-none')."</td></tr>";
        ?>
 </table>
 
index d604db0..49eb25d 100644 (file)
@@ -2,25 +2,15 @@
        if (!verify_user($db, USER_PERMISSION_NETWORK_CREATE))
                exit;
 
-  $skip = false;
-  $msg = false;
+       $lvNetwork = new LibvirtNetwork($lv, $lang);
+       $lvNetworkData = $lvNetwork->createNewNetwork($_POST);
 
-  if (array_key_exists('sent', $_POST)) {
-       if ($_POST['ip_range_cidr'])
-               $ipinfo = $_POST['net_cidr'];
-       else
-               $ipinfo = array('ip' => $_POST['net_ip'], 'netmask' => $_POST['net_mask']);
-
-       $dhcpinfo = ($_POST['setup_dhcp']) ? $_POST['net_dhcp_start'].'-'.$_POST['net_dhcp_end'] : false;
-
-       $tmp = $lv->network_new($_POST['name'], $ipinfo, $dhcpinfo, $_POST['forward'], $_POST['net_forward_dev']);
-       if (!$tmp)
-               $msg = $lv->get_last_error();
-       else {
-               $skip = true;
-               $msg = $lang->get('net_created');
+       if ($lvNetworkData) {
+               $skip = $lvNetworkData['skip'];
+               $msg  = $lvNetworkData['msg'];
        }
-  }
+       else
+               $skip = $msg = false;
 ?>
 
 <?php
 </tr>
 
 <tr>
-    <td align="right"><?php echo $lang->get('net_ip_range_def') ?>:</td>
+    <td align="right"><?php echo $lang->get('net-ip-range-def') ?>:</td>
     <td>
       <select name="ip_range_cidr" onchange="net_ip_change(this.value)" id="ipdef_val">
-       <option value="1"><?php echo $lang->get('net_ip_cidr') ?></option>
-       <option value="0"><?php echo $lang->get('net_ip_direct') ?></option>
+       <option value="1"><?php echo $lang->get('net-ip-cidr') ?></option>
+       <option value="0"><?php echo $lang->get('net-ip-direct') ?></option>
       </select>
     </td>
 </tr>
 
 <tr id="net_ip_cidr">
-    <td align="right"><?php echo $lang->get('net_ipdef_cidr') ?>:</td>
+    <td align="right"><?php echo $lang->get('net-ipdef-cidr') ?>:</td>
     <td><input type="text" name="net_cidr" id="net_cidr" /></td>
 </tr>
 
     <td>
     <table>
        <tr>
-           <td align="right"><?php echo $lang->get('net_ip') ?>:</td>
+           <td align="right"><?php echo $lang->get('net-ip') ?>:</td>
            <td><input type="text" name="net_ip" id="net_ip" /></td>
        </tr>
        <tr>
-           <td align="right"><?php echo $lang->get('net_mask') ?>:</td>
+           <td align="right"><?php echo $lang->get('net-mask') ?>:</td>
            <td><input type="text" name="net_mask" id="net_mask" /></td>
         </tr>
     </table>
     <td>
        <table>
        <tr>
-           <td align="right"><?php echo $lang->get('net_dhcp_start') ?>:</td>
+           <td align="right"><?php echo $lang->get('net-dhcp-start') ?>:</td>
            <td>
              <input type="text" name="net_dhcp_start" />
            </td>
        </tr>
        <tr>
-           <td align="right"><?php echo $lang->get('net_dhcp_end') ?>:</td>
+           <td align="right"><?php echo $lang->get('net-dhcp-end') ?>:</td>
            <td>
              <input type="text" name="net_dhcp_end" />
            </td>
 </tr>
 
 <tr>
-    <td align="right"><?php echo $lang->get('net_forward') ?>:</td>
+    <td align="right"><?php echo $lang->get('net-forward') ?>:</td>
     <td>
       <select name="forward">
-        <option value="none"><?php echo $lang->get('net_forward_none') ?></option>
-        <option value="nat"><?php echo $lang->get('net_forward_nat') ?></option>
-       <option value="route"><?php echo $lang->get('net_forward_route') ?></option>
+        <option value="none"><?php echo $lang->get('net-forward-none') ?></option>
+        <option value="nat"><?php echo $lang->get('net-forward-nat') ?></option>
+       <option value="route"><?php echo $lang->get('net-forward-route') ?></option>
       </select>
     </td>
 </tr>
 
 <tr>
-    <td align="right"><?php echo $lang->get('net_dev') ?>:</td>
+    <td align="right"><?php echo $lang->get('net-dev') ?>:</td>
     <td>
-      <input type="text" name="net_forward_dev" /> (<?php echo $lang->get('net_forward_dev_empty_msg') ?>)
+      <input type="text" name="net_forward_dev" /> (<?php echo $lang->get('net-forward-dev-empty-msg') ?>)
     </td>
 </tr>
 
index 19634df..76a675f 100644 (file)
@@ -2,72 +2,25 @@
        if (!verify_user($db, USER_PERMISSION_VM_CREATE))
                exit;
 
-  $skip = false;
-  $msg = false;
-  if (array_key_exists('sent', $_POST)) {
-       $features = array('apic', 'acpi', 'pae', 'hap');
+       $lvDomain = new LibvirtDomain($lv, $lang);
+       $lvDomainData = $lvDomain->createNewVM($_POST);
 
-       $iso_path = ini_get('libvirt.iso_path');
-
-       $img = $iso_path.'/'.$_POST['install_img'];
-
-       $feature = array();
-       for ($i = 0; $i < sizeof($features); $i++)
-               if (array_key_exists('feature_'.$features[$i], $_POST))
-                       $feature[] = $features[$i];
-
-       $nic = array();
-       if ($_POST['setup_nic']) {
-               $nic['mac'] = $_POST['nic_mac'];
-               $nic['type'] = $_POST['nic_type'];
-               $nic['network'] = $_POST['nic_net'];
-       }
-       $disk = array();
-       if ($_POST['setup_disk']) {
-               if ($_POST['new_vm_disk']) {
-                       $disk['image'] = $_POST['name'].'.'.$_POST['disk_driver'];
-                       $disk['size'] = (int)$_POST['img_data'];
-                       $disk['bus'] = $_POST['disk_bus'];
-                       $disk['driver'] = $_POST['disk_driver'];
-               }
-               else {
-                       $disk['image'] = $_POST['img_data'];
-                       $disk['size'] = 0;
-                       $disk['bus'] = $_POST['disk_bus'];
-                       $disk['driver'] = $_POST['disk_driver'];
-               }
-       }
-
-       $tmp = $lv->domain_new($_POST['name'], $img, $_POST['cpu_count'], $feature, $_POST['memory'], $_POST['maxmem'], $_POST['clock_offset'], $nic, $disk, $_POST['setup_persistent']);
-       if (!$tmp)
-               $msg = $lv->get_last_error();
-       else {
-               $skip = true;
-               $msg = $lang->get('new-vm-created');
-       }
-  }
-
-    $isos = libvirt_get_iso_images();
-
-    $nodetails = false;
-    if (empty($isos))
-      $msg = $lang->get('no_iso');
-
-    $ci  = $lv->get_connect_information();
-    $maxcpu = $ci['hypervisor_maxvcpus'];
-    unset($ci);
+       $skip = $lvDomainData['skip'];
+       $msg  = $lvDomainData['msg'];
+       $isos = $lvDomainData['isos'];
+       $maxvcpu = $lvDomainData['maxvcpu'];
 ?>
 
 <?php
-    if ($msg):
+       if ($msg):
 ?>
     <div id="msg"><b><?php echo $lang->get('msg') ?>: </b><?php echo $msg ?></div>
 <?php
-    endif;
+       endif;
 ?>
 
 <?php
-    if (!$skip):
+       if (!$skip):
 ?>
 <script>
 <!--
     <td>
                <select name="cpu_count">
 <?php
-        for ($i = 1; $i <= $maxcpu; $i++)
-            echo '<option value='.$i.'>'.$i.'</option>';
+               for ($i = 1; $i <= $maxvcpu; $i++)
+                       echo '<option value='.$i.'>'.$i.'</option>';
 ?>
                </select>
 </td>
 </tr>
 
 <tr>
-    <td align="right"><?php echo $lang->get('mem_alloc_max') ?> (MiB):</td>
+    <td align="right"><?php echo $lang->get('mem-alloc-max') ?> (MiB):</td>
     <td><input type="text" name="maxmem" value="512" /></td>
 </tr>
 
     <td>
         <table>
             <tr>
-                <td align="right"><?php echo $lang->get('vm_network_mac') ?>:</td>
+                <td align="right"><?php echo $lang->get('vm-network-mac') ?>:</td>
                 <td>
                        <input type="text" name="nic_mac" value="<?php echo $lv->generate_random_mac_addr() ?>" id="nic_mac_addr" />
                        <input type="button" onclick="generate_mac_addr()" value="<?php echo $lang->get('network-generate-mac') ?>">
                </td>
             </tr>
             <tr>
-                 <td align="right"><?php echo $lang->get('vm_network_type') ?>:</td>
+                 <td align="right"><?php echo $lang->get('vm-network-type') ?>:</td>
                  <td>
                      <select name="nic_type">';
 
 <?php
-       $models = $lv->get_nic_models();
-        for ($i = 0; $i < sizeof($models); $i++)
-                echo '<option value="'.$models[$i].'">'.$models[$i].'</option>';
+               $models = $lv->get_nic_models();
+               for ($i = 0; $i < sizeof($models); $i++)
+                       echo '<option value="'.$models[$i].'">'.$models[$i].'</option>';
 ?>
                      </select>
                  </td>
             </tr>
             <tr>
-                 <td align="right"><?php echo $lang->get('vm_network_net') ?>:</td>
+                 <td align="right"><?php echo $lang->get('vm-network-net') ?>:</td>
                  <td>
                      <select name="nic_net">';
 
 <?php
-        $nets = $lv->get_networks();
-        for ($i = 0; $i < sizeof($nets); $i++)
-                echo '<option value="'.$nets[$i].'">'.$nets[$i].'</option>';
+               $nets = $lv->get_networks();
+               for ($i = 0; $i < sizeof($nets); $i++)
+                       echo '<option value="'.$nets[$i].'">'.$nets[$i].'</option>';
 ?>
                      </select>
                  </td>
             <tr>
                <td align="right">
                        <span id="vm_disk_existing">
-                       <?php echo $lang->get('vm_disk_image')?>:
+                       <?php echo $lang->get('vm-disk-image')?>:
                        </span>
                        <span id="vm_disk_create" style="display: none">
                        <?php echo $lang->get('vm-disk-size') ?> (MiB): 
                <td><input type="text" name="img_data" /></td>
            </tr>
            <tr>
-               <td align="right"><?php echo $lang->get('vm_disk_location') ?>: </td>
+               <td align="right"><?php echo $lang->get('vm-disk-location') ?>: </td>
                <td>
                    <select name="disk_bus">
                        <option value="ide">IDE Bus</option>
                </td>
            </tr>
            <tr>
-               <td align="right"><?php echo $lang->get('vm_disk_type') ?>: </td>
+               <td align="right"><?php echo $lang->get('vm-disk-type') ?>: </td>
                <td>
                    <select name="disk_driver">
                        <option value="raw">raw</option>
                </td>
            </tr>
            <tr>
-               <td align="right"><?php echo $lang->get('vm_disk_dev') ?>: </td>
+               <td align="right"><?php echo $lang->get('vm-disk-dev') ?>: </td>
                <td>hda</td>
            </tr>
        </table>
 </form>
 
 <?php
-  else:
+       else:
 ?>
   <br /><a href="?name=<?php echo $_POST['name'] ?>"><?php echo $lang->get('vm_details') ?></a>
 <?php
-  endif;
+       endif;
 ?>
 
 </div>
index b120ef6..a5dbf6d 100644 (file)
@@ -7,7 +7,7 @@
                echo '<div id="msg"><b>'.$lang->get('msg').': </b>'.$errmsg.'</div>';
 ?>
 
-<?php echo $lang->get('info_msg'); ?>
+<?php echo $lang->get('info-msg'); ?>
 
 <div class="section"><?php echo $lang->get('conns'); ?></div>
 
@@ -22,7 +22,7 @@
                           <tr>
                             <th>'.$spaces.$lang->get('connname').$spaces.'</th>
                             <th>'.$spaces.$lang->get('hypervisor').$spaces.'</th>
-                            <th>'.$spaces.$lang->get('host_type').$spaces.'</th>
+                            <th>'.$spaces.$lang->get('host-type').$spaces.'</th>
                            <th>'.$spaces.$lang->get('host').$spaces.'</th>
                             <th>'.$spaces.$lang->get('logfile').$spaces.'</th>
                            <th>'.$spaces.$lang->get('actions').$spaces.'</td>
                echo '<tr align="center">
                        <td>'.$name.'</td>
                         <td>'.$hv.'</td>
-                        <td>'.($remote ? $lang->get('type_remote') : $lang->get('type_local')).'</td>
+                        <td>'.($remote ? $lang->get('type-remote') : $lang->get('type-local')).'</td>
                        <td>'.($host ? $host : '-').'</td>
                         <td>'.($logfile ? $logfile : '-').'</td>
                        <td>
                                <a href="?connect='.$id.'">'.$lang->get('connect').'</a> |
-                               <a href="?remove_conn='.$id.'">'.$lang->get('conn_remove').'</a>
+                               <a href="?remove_conn='.$id.'">'.$lang->get('conn-remove').'</a>
                        </td>
                       </tr>';
        }
 
        if (sizeof($tmp) == 0)