<?php
/**
 * @see IntegerNet_GermanStoreConfig_Block_Form
 * @var $this IntegerNet_GermanStoreConfig_Block_Form
 */
?>

<div class="content-header">
    <h3><?php echo $this->__(Mage::getStoreConfig('germanstoreconfig/module_title')) ?></h3>
    <p class="form-buttons">
        <?php echo $this->getButtonHtml(Mage::helper('adminhtml')->__('Save'), 'setupForm.submit();', 'save'); ?>
    </p>
</div>

<p><?php echo $this->__('Please enter your data:') ?></p>

<div class="entry-edit">
    <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="setup_form">
        <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
        <div class="entry-edit-head">
            <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Shop Data') ?></h4>
            <div class="form-buttons"></div>
        </div>

        <div class="fieldset" id="group_fields">
            <div class="hor-scroll">
                <table cellspacing="0" class="form-list">
                    <tbody>
                    <?php foreach($this->getInputFields() as $field): ?>
                        <tr>
                            <td class="label"><label for="field_<?php echo $field['name'] ?>"><?php echo $field['label'] ?></label></td>
                            <td class="value">
                                <?php if ($field['type'] == 'select'): ?>
                                <select name="field[<?php echo $field['name'] ?>]" id="field_<?php echo $field['label'] ?>" style="width:150px !important;">
                                    <?php $value = $this->getValue($field['name']) ?>
                                    <?php foreach(Mage::getSingleton($field['source_model'])->toOptionArray() as $option): ?>
                                    <option value="<?php echo $option['value'] ?>"<?php if($option['value'] == $value): ?> selected="selected"<?php endif ?>>
                                        <?php echo $option['label'] ?>
                                    </option>
                                    <?php endforeach ?>
                                </select>
                                <?php elseif($field['type'] == 'textarea'): ?>
                                <textarea name="field[<?php echo $field['name'] ?>]" id="field_<?php echo $field['label'] ?>"><?php echo $this->getValue($field['name']) ?></textarea>
                                <?php else: ?>
                                <input type="text" name="field[<?php echo $field['name'] ?>]" id="field_<?php echo $field['label'] ?>"class="input-text" value="<?php echo $this->getValue($field['name']) ?>" />
                                <?php endif ?>
                            </td>
                            <td class="comment">
                                <?php if (isset($field['optional']) && $field['optional']): ?>
                                    (<?php echo $this->__('optional') ?>)
                                <?php endif ?>
                            </td>
                        </tr>
                    <?php endforeach ?>
                    </tbody>
                </table>
            </div>
        </div>

        <div class="entry-edit-head">
            <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('PayPal') ?></h4>
            <div class="form-buttons"></div>
        </div>

        <div class="fieldset" id="group_paypal">
            <div class="hor-scroll">
                <table cellspacing="0" class="form-list">
                    <tbody>
                        <tr>
                            <td class="label"><label for="field_paypal_email"><?php echo $this->__('PayPal Merchant Account Email Address') ?></label></td>
                            <td class="value">
                                <input type="text" name="paypal_email" id="field_paypal_email" class="input-text" value="<?php echo Mage::getStoreConfig('paypal/general/business_account') ?>" />
                            </td>
                            <td class="comment">(<?php echo $this->__('optional') ?>)</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>

        <?php if (sizeof($this->getAdditionalLanguages())): ?>
        <div class="entry-edit-head">
            <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Store Languages') ?></h4>
            <div class="form-buttons"></div>
        </div>

        <div class="fieldset" id="group_paypal">
            <div class="hor-scroll">
                <table cellspacing="0" class="form-list">
                    <tbody>
                        <tr>
                            <td class="label"><label for="field_paypal_email"><?php echo $this->__('Create Additional Store Languages') ?></label></td>
                            <td class="value">
                                <?php foreach($this->getAdditionalLanguages() as $languageCode => $languageName): ?>
                                <input type="checkbox" name="language[<?php echo $languageCode ?>]" id="field_language_<?php echo $languageCode ?>" class="checkbox" value="1" />
                                <label for="field_language_<?php echo $languageCode ?>"><?php echo $this->__($languageName) ?></label>
                                <br />
                                <?php endforeach ?>
                                (<?php echo $this->__('German language will be created automatically.') ?>)
                            </td>
                            <td class="comment"></td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <?php endif ?>

        <div class="entry-edit-head">
            <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Help to improve Magento DE - data transfer') ?></h4>
            <div class="form-buttons"></div>
        </div>

        <div class="fieldset" id="group_datatransfer">
            <div class="hor-scroll">
                <table cellspacing="0" class="form-list">
                    <tbody>
                        <tr>
                            <td colspan="2">
                                <p><?php echo $this->__('Magento DE ist a project from the community, for the community. The German shop configuration for the Magento Community Edition has been created to make the entry to Magento as easy as possible. This project has been initiated by the Netresearch App Factory. The implementation is being lead by integer_net and their experienced developers, who integratet the best and most important extensions for the German market together with the community.') ?></p>
                                <p><?php echo $this->__('Your consent for transferring usage and contact details through Magento DE enables the developers and community partners to further distribute, develop, and continually improve Magento DE. This way, you and many other merchants can profit from an up-to-date and attractive Magento DE system plus frequent adaptions for the German market.') ?></p>
                                <p><?php echo $this->__('Of course, you can decide what data you wish to be transmitted. In general, this project is only interested in information about the use of the system and, were indicated, contact details from your imprint. No further information or data will be transmitted.') ?></p>
                                <p><?php echo $this->__('Thank you very much in advance for your help.') ?></p>
                            </td>
                        </tr>
                        <tr>
                            <td class="value">
                                <input
                                        type="radio"
                                        name="field[admin__germanstoreconfig__datatransfer]"
                                        id="field_datatransfer_none"
                                        value="<?php echo IntegerNet_GermanStoreConfig_Model_Source_Datatransfer::DATATRANSFER_NONE ?>"
                                        <?php if(Mage::getStoreConfig('admin/germanstoreconfig/datatransfer') == IntegerNet_GermanStoreConfig_Model_Source_Datatransfer::DATATRANSFER_NONE): ?>checked="checked"<?php endif ?>
                                />
                            </td>
                            <td class="value">
                                <label for="field_datatransfer_none"><?php echo $this->__('I wish no information to be transmitted.') ?></label>
                            </td>
                            <td class="comment"></td>
                        </tr>
                        <tr>
                            <td class="value">
                                <input
                                        type="radio"
                                        name="field[admin__germanstoreconfig__datatransfer]"
                                        id="field_datatransfer_basic"
                                        value="<?php echo IntegerNet_GermanStoreConfig_Model_Source_Datatransfer::DATATRANSFER_BASIC ?>"
                                        <?php if(Mage::getStoreConfig('admin/germanstoreconfig/datatransfer') == IntegerNet_GermanStoreConfig_Model_Source_Datatransfer::DATATRANSFER_BASIC): ?>checked="checked"<?php endif ?>
                                />
                            </td>
                            <td class="value">
                                <label for="field_datatransfer_basic"><?php echo $this->__('I want to help monitor the distribution of Magento DE and therefore agree on transmitting only the information necessary to accomplish this, thereby supporting the project.') ?></label><br />
                                <p id="datatransfer_basic_information_link"><a style="cursor: pointer;" onclick="$('datatransfer_basic_information_list').show(); $('datatransfer_basic_information_link').hide();"><?php echo $this->__('What information will be transmitted?') ?></a></p>
                                <ul style="list-style: disc outside; margin-left: 30px; display: none;" id="datatransfer_basic_information_list">
                                    <li><?php echo $this->__('Server IP') ?></li>
                                    <li><?php echo $this->__('Request Date') ?></li>
                                </ul>
                            </td>
                            <td class="comment"></td>
                        </tr>
                        <tr>
                            <td class="value">
                                <input
                                        type="radio"
                                        name="field[admin__germanstoreconfig__datatransfer]"
                                        id="field_datatransfer_advanced"
                                        value="<?php echo IntegerNet_GermanStoreConfig_Model_Source_Datatransfer::DATATRANSFER_ADVANCED ?>"
                                        <?php if(Mage::getStoreConfig('admin/germanstoreconfig/datatransfer') == IntegerNet_GermanStoreConfig_Model_Source_Datatransfer::DATATRANSFER_ADVANCED): ?>checked="checked"<?php endif ?>
                                />
                            </td>
                            <td class="value">
                                <label for="field_datatransfer_advanced"><?php echo $this->__('I want to help monitor the distribution of Magento DE and also want to profit from exclusive offers from the NR App Factory and their partners.') ?></label><br />
                                <p id="datatransfer_advanced_offer_link"><a style="cursor: pointer;" onclick="$('datatransfer_advanced_offer_list').show(); $('datatransfer_advanced_offer_text').show(); $('datatransfer_advanced_offer_link').hide();"><?php echo $this->__('This could be your exclusive offers') ?></a></p>
                                <p id="datatransfer_advanced_offer_text" style="display: none;"><?php echo $this->__('Offers could be for example:') ?></p>
                                <ul id="datatransfer_advanced_offer_list" style="list-style: disc outside; margin-left: 30px; display: none;">
                                    <li><?php echo $this->__('Special conditions when purchasing extensions or services from the NAF store nr.apps.com') ?></li>
                                    <li><?php echo $this->__('Purchase options and special conditions for Magento event tickes, e.g. Meet Magento or Developers Paradise') ?></li>
                                    <li><?php echo $this->__('Purchase options and special conditions for Magento education tickets, e.g. NR Campus') ?></li>
                                    <li><?php echo $this->__('Showing your shop name and a link to your domain on nr-apps.com') ?></li>
                                    <li><?php echo $this->__('and many more') ?></li>
                                </ul>
                                <p><?php echo $this->__('For your personal offers and information about Magento DE, please see the newsfeed of your system.') ?></p>
                                <p><?php echo $this->__('I agree to help monitor the distribution of Magento DE and therefore agree on transmitting the information necessary to accomplish this, thereby supporting the project.') ?></p>
                                <p id="datatransfer_advanced_information_link"><a style="cursor: pointer;" onclick="$('datatransfer_advanced_information_list').show(); $('datatransfer_advanced_information_link').hide();"><?php echo $this->__('What information will be transmitted?') ?></a></p>
                                <ul style="list-style: disc outside; margin-left: 30px; display: none;" id="datatransfer_advanced_information_list">
                                    <li><?php echo $this->__('Server IP') ?></li>
                                    <li><?php echo $this->__('Request Date') ?></li>
                                    <li><?php echo $this->__('Magento Version') ?></li>
                                    <li><?php echo $this->__('Imprint Datas: Shop Name, Company, Street, ZIP, City, Country, Telephone, Fax, Email, Website, CEO, Owner') ?></li>
                                </ul><br/>
                            </td>
                            <td class="comment"></td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <p><?php echo $this->__('Further information on data privacy can be found <a href="%s" target="_blank">here</a>.', 'http://de.nr-apps.com/store/datenschutz/') ?></p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    setupForm = new varienForm('setup_form', '');
</script>
