<?php
    add_action('dslc_hook_register_modules',
         create_function('', 'return dslc_register_module( "Ainex_Domain_Logo" );')
    );

class Ainex_Domain_Logo extends DSLC_Module {

    // Module Attributes
    var $module_id = 'Ainex_Domain_Logo';
    var $module_title = 'Domain Logo';
    var $module_icon = 'font';
    var $module_category = 'Ainex - Blocks';

    // Module Options
    function options() {
        // The options array
        $dslc_options = array(
            array(
                'label' => 'Domain Logo - Show/Hidden Logo 1',
                'id' => 'logo_1_custom',
                'std' => '1',
                'type' => 'select',
                'choices' => array(
                    array(
                        'label' => 'Show',
                        'value' => '1'
                    ),
                    array(
                        'label' => 'Hidden',
                        'value' => '0'
                    ),
                ),
                'tab'   => 'Logo 1',
            ),
            array(
                'label' => __( 'Image', 'dslc_string' ),
                'id' => 'logo_1_image',
                'std' => get_template_directory_uri().'/assets/images/dot-com.png',
                'type' => 'image',
                'tab'   => 'Logo 1',
            ),
            array(
                'label' => __( 'Description', 'dslc_string' ),
                'id'    => 'logo_1_desc',
                'std'   => '<em>From</em> $4.99/year',
                'type'  => 'text',
                'tab'   => 'Logo 1',
            ),
            array(
                'label' => 'Show/Hidden Logo 2',
                'id' => 'logo_2_custom',
                'std' => '1',
                'type' => 'select',
                'choices' => array(
                    array(
                        'label' => 'Show',
                        'value' => '1'
                    ),
                    array(
                        'label' => 'Hidden',
                        'value' => '0'
                    ),
                ),
                'tab'   => 'Logo 2',
            ),
            array(
                'label' => __( 'Image', 'dslc_string' ),
                'id' => 'logo_2_image',
                'std' => get_template_directory_uri().'/assets/images/dot-org.png',
                'type' => 'image',
                'tab'   => 'Logo 2',
            ),
            array(
                'label' => __( 'Description', 'dslc_string' ),
                'id'    => 'logo_2_desc',
                'std'   => '<em>From</em> $4.99/year',
                'type'  => 'text',
                'tab'   => 'Logo 2',
            ),
            array(
                'label' => 'Show/Hidden Logo 3',
                'id' => 'logo_3_custom',
                'std' => '1',
                'type' => 'select',
                'choices' => array(
                    array(
                        'label' => 'Show',
                        'value' => '1'
                    ),
                    array(
                        'label' => 'Hidden',
                        'value' => '0'
                    ),
                ),
                'tab'   => 'Logo 3',
            ),
            array(
                'label' => __( 'Image', 'dslc_string' ),
                'id' => 'logo_3_image',
                'std' => get_template_directory_uri().'/assets/images/dot-co.png',
                'type' => 'image',
                'tab'   => 'Logo 3',
            ),
            array(
                'label' => __( 'Description', 'dslc_string' ),
                'id'    => 'logo_3_desc',
                'std'   => '<em>From</em> $4.99/year',
                'type'  => 'text',
                'tab'   => 'Logo 3',
            ),
            array(
                'label' => 'Show/Hidden Logo 4',
                'id' => 'logo_4_custom',
                'std' => '1',
                'type' => 'select',
                'choices' => array(
                    array(
                        'label' => 'Show',
                        'value' => '1'
                    ),
                    array(
                        'label' => 'Hidden',
                        'value' => '0'
                    ),
                ),
                'tab'   => 'Logo 4',
            ),
            array(
                'label' => __( 'Image', 'dslc_string' ),
                'id' => 'logo_4_image',
                'std' => get_template_directory_uri().'/assets/images/dot-net.png',
                'type' => 'image',
                'tab'   => 'Logo 4',
            ),
            array(
                'label' => __( 'Description', 'dslc_string' ),
                'id'    => 'logo_4_desc',
                'std'   => '<em>From</em> $4.99/year',
                'type'  => 'text',
                'tab'   => 'Logo 4',
            ),
        );

        $dslc_options = array_merge( $dslc_options, $this->shared_options('animation_options') );

        // Return the array
        return apply_filters( 'dslc_module_options', $dslc_options, $this->module_id );

    }

    // Module Output
    function output( $options ) {

        global $dslc_active;

        if ( $dslc_active && is_user_logged_in() && current_user_can( DS_LIVE_COMPOSER_CAPABILITY ) )
            $dslc_is_admin = true;
        else
            $dslc_is_admin = false;

        //REQUIRED
        $this->module_start( $options );
?>

    <div class="domain_search">
        <div class="container">
            <div class="right_logo">
                <ul>
                    <?php if ($options['logo_1_custom']==1): ?>
                        <li>
                            <?php if ($options['logo_1_image']): ?>
                                <img src="<?php echo $options['logo_1_image']; ?>" alt="" />
                            <?php endif ?>
                            <?php echo $options['logo_1_desc']; ?>
                        </li>
                    <?php endif ?>
                    <?php if ($options['logo_2_custom']==1): ?>
                        <li>
                            <?php if ($options['logo_2_image']): ?>
                                <img src="<?php echo $options['logo_2_image']; ?>" alt="" />
                            <?php endif ?>
                            <?php echo $options['logo_2_desc']; ?>
                        </li>
                    <?php endif ?>
                    <?php if ($options['logo_3_custom']==1): ?>
                        <li>
                            <?php if ($options['logo_3_image']): ?>
                                <img src="<?php echo $options['logo_3_image']; ?>" alt="" />
                            <?php endif ?>
                            <?php echo $options['logo_3_desc']; ?>
                        </li>
                    <?php endif ?>
                    <?php if ($options['logo_4_custom']==1): ?>
                        <li>
                            <?php if ($options['logo_4_image']): ?>
                                <img src="<?php echo $options['logo_4_image']; ?>" alt="" />
                            <?php endif ?>
                            <?php echo $options['logo_4_desc']; ?>
                        </li>
                    <?php endif ?>
                </ul>
            </div>
        </div>
    </div>

<?php
        // REQUIRED
        $this->module_end( $options );

    }

}