<?php

$About = get_transient('awesome_live_chat_about');
/*$version_available = false;
$Promotion = array();
if($About !== false && is_array($About) && $About)
{
    $version_available = isset($About['version'])
    ? $About['version'] : false;
    $Promotion = isset($About['promotion'])
    ? $About['promotion'] : array();
}*/

/*
$version = $this->Boots->Database
->term('awesome_live_chat')->get();
$version_html = '
    <label for="alc_settings_license_username">Version</label>
    ' . ($version_available ? '<p>Currently using</p><hr />' : '') . '
    <div class="boots-form-input">
        <h3 style="
            color: #B2B1B1;
            font-size: 50px;
            line-height: 80px;
            font-weight: bold;
            text-align: center;
        ">' . $version . '</h3>
    </div>';
if($version_available)
{
    $version_html .=  '
        <hr />
        <p>Update available</p>
        <div class="boots-form-input">
            <h3 style="
                color: #0074A2;
                font-size: 50px;
                line-height: 80px;
                font-weight: bold;
                text-align: center;
            ">' . $version_available . '</h3>
        </div>
        <!--<p>You should update.</p>-->';
}*/

$this->Admin->section(__('About', 'awesome-live-chat'))
//->add('html', array('html' => $version_html))
->add('html', array(
    'html'  => '
    <label for="alc_license_code">Product License</label>
    <div class="boots-form-input">
        <input type="text" name="alc_license_code" id="alc_license_code" value="' . (isset($License['code']) ? $License['code'] : '') . '">
    </div>
    <hr />
    <div>
        <button id="alc_license_activate_btn" class="button-primary" style="float: right; margin-right: 15px;"' . (isset($License['verified']) && $License['verified'] ? ' disabled="disabled"' : '') . '>' . __('Activate License', 'awesome-live-chat') . '</button>
        <button id="alc_license_revoke_btn" class="button" style="margin-left: 15px;"' . (isset($License['verified']) && $License['verified'] ? '' : ' disabled="disabled"') . '>' . __('Revoke License', 'awesome-live-chat') . '</button>
    </div>
    <hr />
    <p>
        ' . __('Enter plugin purchase key to verify yourself as a buyer.<br />Note: Update interval is 10 minutes.', 'awesome-live-chat') . '
    </p>'
))->add('textbox', array(
    'title' => __('Earn $$$', 'awesome-live-chat'),
    'id'    => 'alc_settings_about_power',
    'name'  => 'alc_settings[about][power]',
    'help'  => __('Enter your envato username to provide a powered by link at the bottom of the chat with your referral link.', 'awesome-live-chat'),
    'value' => $Settings['power']
));

$Promotions = $About !== false && is_array($About) && $About
? $About : array();
foreach($Promotions as $Promo)
{
    if(isset($Promo['html']))
    $this->Admin->add('html', array(
        'html' => $Promo['html']
    ));
}