<?
/**
 * Copyright © 2012 Alcatel-Lucent.
 *
 * See the NOTICE file distributed with this work for additional information regarding copyright ownership. Licensed to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License.
 */

$config = $this->config;
$validationErrors = $this->validationErrors;
?>
<div class="container">
    <h1><? echo $this->translate("Preferences")?></h1>
    <p><? echo $this->translate("Only change the settings below if you really know what you are doing")?> :)</p>
    <? if(!empty($this->flashMessage)): ?>
    <div class="control-group success"><span class="help-block"><?=$this->flashMessage?></span></div>
    <? endif ?>
    <? if(!empty($validationErrors['default'])): ?>
    <div class="control-group error"><span class="help-block"><?=$validationErrors['default']?></span></div>
    <? endif ?>
    <form method="POST" class="well form-horizontal">
        <fieldset>
            <div class="control-group <?=empty($validationErrors['manager_host'])?"":"error"?>" id="ctl-group-manager">
                <label class="control-label" for="aghost"><? echo $this->translate("Manager Host")?></label>
                <div class="controls">
                    <input type="text" name="config[manager_host]" id="aghost" value="<?=@$config->manager_host?>"
                            placeholder="127.0.0.1" />
                    <span class="help-inline">
                        <?=@$validationErrors['manager_host']?>
                    </span>
                </div>
            </div>
            <div class="control-group <?=empty($validationErrors['gateway_host'])?"":"error"?>" id="ctl-group-gateway">
                <label class="control-label" for="gateway_host"><? echo $this->translate("Gateway Host")?></label>
                <div class="controls">
                    <input type="text" name="config[gateway_host]" id="gateway_host" value="<?=@$config->gateway_host?>"
                           placeholder="127.0.0.1" />
                    <span class="help-inline">
                        <?=@$validationErrors['gateway_host']?>
                    </span>
                </div>
            </div>
            <input type="submit" class="btn btn-primary" value="<? echo $this->translate("Save")?>"/>
        </fieldset>
    </form>
</div>