<?php

//$ysPrefix = '<style>.listitemfloating .logo {display:inline-block; width:15px; height:15px; line-height: 16px; text-align: center; background-color: #000; color:#FFF;} h1 .logo {display:inline-block; width:31px; height:31px; line-height: 31px; text-align: center; background-color: #000; color:#FFF;} .logo {margin-right: 5px;}</style><span class="logo">Y</span>';

/**
 * Metadata version
 */
$sMetadataVersion = '2.1';

/**
 * Module information
 */
$aModule = array(
    'id'          => 'ys_giftcert',
    'title'       => '[Y-SQUARE] Geschenk-Gutscheine',
    'description' => array(
        'de' => 'Modul f&uuml;r den Verkauf und die Nutzung von Geschenk-Gutscheinen.',
        'en' => 'Gift certificates module.',
    ),
    'thumbnail'   => 'logo.png',
    'version'     => '2.1.21',
    'author'      => 'Y-SQUARE',
    'url'         => 'https://www.y-square.de/',
    'email'       => 'info@y-square.de',
    'extend'      => array(
        //Core
        \OxidEsales\Eshop\Core\Email::class                               => \YSquare\GiftCert\Core\Email::class,
        \OxidEsales\Eshop\Core\ViewConfig::class                          => \YSquare\GiftCert\Core\ViewConfig::class,

        //Controller
        \OxidEsales\Eshop\Application\Controller\BasketController::class  => \YSquare\GiftCert\Controller\BasketController::class,
        \OxidEsales\Eshop\Application\Controller\UserController::class    => \YSquare\GiftCert\Controller\UserController::class,
        \OxidEsales\Eshop\Application\Controller\PaymentController::class => \YSquare\GiftCert\Controller\PaymentController::class,
        \OxidEsales\Eshop\Application\Controller\OrderController::class   => \YSquare\GiftCert\Controller\OrderController::class,

        //Models
        \OxidEsales\Eshop\Application\Model\Article::class                => \YSquare\GiftCert\Model\Article::class,
        \OxidEsales\Eshop\Application\Model\OrderArticle::class           => \YSquare\GiftCert\Model\OrderArticle::class,
        \OxidEsales\Eshop\Application\Model\Basket::class                 => \YSquare\GiftCert\Model\Basket::class,
        \OxidEsales\Eshop\Application\Model\BasketItem::class             => \YSquare\GiftCert\Model\BasketItem::class,
        \OxidEsales\Eshop\Application\Model\PaymentList::class            => \YSquare\GiftCert\Model\PaymentList::class,
        \OxidEsales\Eshop\Application\Model\Order::class                  => \YSquare\GiftCert\Model\Order::class,
        \OxidEsales\Eshop\Application\Model\User::class                   => \YSquare\GiftCert\Model\User::class,
    ),
    'controllers' => array(
        'ys_giftcert__admin_logs' => YSquare\GiftCert\Controller\Admin\GiftCertLogController::class,
        'ys_giftcert__admin_ajax' => YSquare\GiftCert\Controller\Admin\GiftCertLogAjax::class,
        'ys_giftcert__admin_user' => YSquare\GiftCert\Controller\Admin\GiftCertUserController::class,
        'account_ysgiftcert'      => YSquare\GiftCert\Controller\AccountGiftcertController::class,
    ),
    'events'      => array(
        'onActivate'   => '\YSquare\GiftCert\Core\Events::onActivate',
        'onDeactivate' => '\YSquare\GiftCert\Core\Events::onDeactivate',
    ),
    'templates'   => array(
        // Admin
        'ys_giftcert__admin_logs.tpl'                                    => 'ysquare/ys_giftcert/views/admin/tpl/ys_giftcert__admin_logs.tpl',
        'ys_giftcert__admin_user.tpl'                                    => 'ysquare/ys_giftcert/views/admin/tpl/ys_giftcert__admin_user.tpl',

        // Frontend
        'page/account/giftcert.tpl'                                      => 'ysquare/ys_giftcert/views/tpl/page/account/giftcert.tpl',

        // eMail
        'email/html/ys_giftcert_to_recipient.tpl'                        => 'ysquare/ys_giftcert/views/tpl/email/html/ys_giftcert_to_recipient.tpl',
        'email/plain/ys_giftcert_to_recipient.tpl'                       => 'ysquare/ys_giftcert/views/tpl/email/plain/ys_giftcert_to_recipient.tpl',
        'email/html/ys_giftcert_to_purchaser.tpl'                        => 'ysquare/ys_giftcert/views/tpl/email/html/ys_giftcert_to_purchaser.tpl',
        'email/plain/ys_giftcert_to_purchaser.tpl'                       => 'ysquare/ys_giftcert/views/tpl/email/plain/ys_giftcert_to_purchaser.tpl',
        'email/html/ys_giftcert_to_shopowner.tpl'                        => 'ysquare/ys_giftcert/views/tpl/email/html/ys_giftcert_to_shopowner.tpl',
        'email/plain/ys_giftcert_to_shopowner.tpl'                       => 'ysquare/ys_giftcert/views/tpl/email/plain/ys_giftcert_to_shopowner.tpl',

        // Giftcert PDF Template
        'giftcert/default.tpl'                                           => 'ysquare/ys_giftcert/views/tpl/giftcert/default.tpl',

        // Block Templates (to be able to overwrite them in Theme)
        'blocks/ys_giftcert_checkout_use_pool_money.tpl'                 => 'ysquare/ys_giftcert/views/tpl/blocks/ys_giftcert_checkout_use_pool_money.tpl',
        'blocks/ys_giftcert_basketcontents_voucherdiscount.tpl'          => 'ysquare/ys_giftcert/views/tpl/blocks/ys_giftcert_basketcontents_voucherdiscount.tpl',
        'blocks/ys_giftcert_details_productmain_tobasket.tpl'            => 'ysquare/ys_giftcert/views/tpl/blocks/ys_giftcert_details_productmain_tobasket.tpl',
        'blocks/ys_giftcert_details_productmain_persparams.tpl'          => 'ysquare/ys_giftcert/views/tpl/blocks/ys_giftcert_details_productmain_persparams.tpl',
        'blocks/ys_giftcert_details_productmain_deliverytime.tpl'        => 'ysquare/ys_giftcert/views/tpl/blocks/ys_giftcert_details_productmain_deliverytime.tpl',
        'blocks/ys_giftcert_details_productmain_stockstatus.tpl'         => 'ysquare/ys_giftcert/views/tpl/blocks/ys_giftcert_details_productmain_stockstatus.tpl',
        'blocks/ys_giftcert_email_html_order_cust_voucherdiscount.tpl'   => 'ysquare/ys_giftcert/views/tpl/blocks/ys_giftcert_email_html_order_cust_voucherdiscount.tpl',
        'blocks/ys_giftcert_email_html_order_owner_voucherdiscount.tpl'  => 'ysquare/ys_giftcert/views/tpl/blocks/ys_giftcert_email_html_order_owner_voucherdiscount.tpl',
        'blocks/ys_giftcert_email_plain_order_cust_voucherdiscount.tpl'  => 'ysquare/ys_giftcert/views/tpl/blocks/ys_giftcert_email_plain_order_cust_voucherdiscount.tpl',
        'blocks/ys_giftcert_email_plain_order_owner_voucherdiscount.tpl' => 'ysquare/ys_giftcert/views/tpl/blocks/ys_giftcert_email_plain_order_owner_voucherdiscount.tpl',
    ),
    'blocks'      => array(
        // ************ Admin Backend ***************
        array(
            'template' => 'article_main.tpl',
            'block'    => 'admin_article_main_form',
            'file'     => '/views/blocks/admin_article_main_form.tpl',
        ),
        array(
            'template' => 'order_overview.tpl',
            'block'    => 'admin_order_overview_total',
            'file'     => '/views/blocks/admin_order_overview_total.tpl',
        ),
        // ************ Product Frontend ***************
        array(
            'template' => 'page/details/inc/productmain.tpl',
            'block'    => 'details_productmain_stockstatus',
            'file'     => '/views/blocks/details_productmain_stockstatus.tpl',
        ),
        array(
            'template' => 'page/details/inc/productmain.tpl',
            'block'    => 'details_productmain_persparams',
            'file'     => '/views/blocks/details_productmain_persparams.tpl',
        ),
        array(
            'template' => 'page/details/inc/productmain.tpl',
            'block'    => 'details_productmain_price',
            'file'     => '/views/blocks/details_productmain_price.tpl',
        ),
        array(
            'template' => 'page/details/inc/productmain.tpl',
            'block'    => 'details_productmain_tobasket',
            'file'     => '/views/blocks/details_productmain_tobasket.tpl',
        ),
        array(
            'template' => 'page/details/inc/productmain.tpl',
            'block'    => 'details_productmain_deliverytime',
            'file'     => '/views/blocks/details_productmain_deliverytime.tpl',
        ),
        array(
            'template' => 'widget/product/listitem_grid.tpl',
            'block'    => 'widget_product_listitem_grid_price_value',
            'file'     => '/views/blocks/widget_product_listitem_grid_price_value.tpl',
        ),
        array(
            'template' => 'widget/product/listitem_infogrid.tpl',
            'block'    => 'widget_product_listitem_infogrid_price_value',
            'file'     => '/views/blocks/widget_product_listitem_infogrid_price_value.tpl',
        ),
        array(
            'template' => 'widget/product/listitem_line.tpl',
            'block'    => 'widget_product_listitem_line_price_value',
            'file'     => '/views/blocks/widget_product_listitem_line_price_value.tpl',
        ),
        // *********** Checkout **************
        array(
            'template' => 'page/checkout/inc/basketcontents.tpl',
            'block'    => 'checkout_basketcontents_voucherdiscount',
            'file'     => '/views/blocks/checkout_basketcontents_voucherdiscount.tpl',
        ),
        array(
            'template' => 'page/checkout/inc/basketcontents_list.tpl',
            'block'    => 'checkout_basketcontents_basketitem_persparams',
            'file'     => '/views/blocks/checkout_basketcontents_basketitem_persparams.tpl',
        ),
        // MAYBE LATER ADD A SWITCH TO USE DEFAULT BLOCK "checkout_payment_nextstep"
        array(
            'template' => 'page/checkout/payment.tpl',
            'block'    => 'ys_giftcert_checkout_use_pool_money',
            'file'     => '/views/blocks/checkout_payment_use_pool_money.tpl',
        ),
        // ************** email ****************
        array(
            'template' => 'email/html/order_cust.tpl',
            'block'    => 'email_html_order_cust_voucherdiscount',
            'file'     => '/views/blocks/email_html_order_cust_voucherdiscount.tpl',
        ),
        array(
            'template' => 'email/html/order_owner.tpl',
            'block'    => 'email_html_order_owner_voucherdiscount',
            'file'     => '/views/blocks/email_html_order_owner_voucherdiscount.tpl',
        ),
        array(
            'template' => 'email/plain/order_cust.tpl',
            'block'    => 'email_plain_order_cust_voucherdiscount',
            'file'     => '/views/blocks/email_plain_order_cust_voucherdiscount.tpl',
        ),
        array(
            'template' => 'email/plain/order_owner.tpl',
            'block'    => 'email_plain_order_owner_voucherdiscount',
            'file'     => '/views/blocks/email_plain_order_owner_voucherdiscount.tpl',
        ),
    ),
    'settings'    => array(
        array(
            'group' => 'Ysgiftcert_payment',
            'name'  => 'aYsGiftcertAllowedPaymenttypes',
            'type'  => 'arr',
            'value' => []
        ),
        array(
            'group' => 'Ysgiftcert_payment',
            'name'  => 'aYsGiftcertAllowedPaymenttypesOffline',
            'type'  => 'arr',
            'value' => []
        ),
        array(
            'group' => 'Ysgiftcert_payment',
            'name'  => 'aYsGiftcertAllowedPaymenttypesBusiness',
            'type'  => 'arr',
            'value' => []
        ),
        array(
            'group' => 'Ysgiftcert_payment',
            'name'  => 'aYsGiftcertAllowedShippingtypesOnline',
            'type'  => 'arr',
            'value' => []
        ),
        array(
            'group' => 'Ysgiftcert_payment',
            'name'  => 'aYsGiftcertAllowedShippingtypesOffline',
            'type'  => 'arr',
            'value' => []
        ),
        array(
            'group' => 'Ysgiftcert_payment',
            'name'  => 'aYsGiftcertAllowedShippingtypesBusiness',
            'type'  => 'arr',
            'value' => []
        ),
        array(
            'group' => 'Ysgiftcert',
            'name'  => 'aYsGiftcertPrefix',
            'type'  => 'str',
            'value' => 'GS'
        ),
        array(
            'group' => 'Ysgiftcert',
            'name'  => 'iYsGiftcertTimeout',
            'type'  => 'str',
            'value' => ''
        ),
        array(
            'group' => 'Ysgiftcert',
            'name'  => 'dYsGiftcertMinValue',
            'type'  => 'str',
            'value' => '1'
        ),
        array(
            'group' => 'Ysgiftcert',
            'name'  => 'blYsGiftcertRedeemPartly',
            'type'  => 'bool',
            'value' => 'false'
        ),
        array(
            'group' => 'Ysgiftcert',
            'name'  => 'blYsGiftcertRedeemToPool',
            'type'  => 'bool',
            'value' => 'false'
        ),
        array(
            'group' => 'Ysgiftcert',
            'name'  => 'sYsGiftcertPaymentForPool',
            'type'  => 'str',
            'value' => 'oxempty'
        ),
        array(
            'group' => 'Ysgiftcert',
            'name'  => 'iYsGiftcertInvalidateThreshold',
            'type'  => 'str',
            'value' => '0'
        ),
        array(
            'group' => 'Ysgiftcert',
            'name'  => 'sYsGiftcertLength',
            'type'  => 'str',
            'value' => '8'
        ),
        array(
            'group' => 'Ysgiftcert',
            'name'  => 'sYsGiftcertAllowedChars',
            'type'  => 'str',
            'value' => '0123456789abcdefghijklmnopqrstuvwxyz'
        ),
        array(
            'group' => 'Ysgiftcert',
            'name'  => 'iYsGiftcertKeepBrokenOrdersInDays',
            'type'  => 'str',
            'value' => '3'
        ),
        array(
            'group' => 'Ysgiftcert',
            'name'  => 'aYsGiftcertPaymentSuccessfulStates',
            'type'  => 'arr',
            'value' => ["OK"]
        ),
        array(
            'group'       => 'Ysgiftcert',
            'name'        => 'sYsGiftcertLogMode',
            'type'        => 'select',
            'constraints' => 'off|error|debug',
            'value'       => 'off',
        ),
    ),
);
