<?php

$KOPA_LAYOUT = array(
    'front-page-right-sidebar' => array(
        'title' => 'Front Page Right Sidebar',
        'thumbnails' => 'front-page-right-sidebar.jpg',
        'positions' => array(
            'position_1',
            'position_2',
            'position_3',
            'position_4',
            'position_5',
            'position_14',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'front-page-full-width' => array(
        'title' => 'Full Width Page',
        'thumbnails' => 'front-full-width.jpg',
        'positions' => array(
            'position_11',
            'position_12',
            'position_13',
            'position_14',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'blog-1-left-sidebar' => array(
        'title' => 'Blog style 1 - left sidebar',
        'thumbnails' => 'blog-1-left-sidebar.jpg',
        'positions' => array(
            'position_10',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'blog-1-right-sidebar' => array(
        'title' => 'Blog style 1 - right sidebar',
        'thumbnails' => 'blog-1-right-sidebar.jpg',
        'positions' => array(
            'position_1',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'blog-1-two-sidebar' => array(
        'title' => 'Blog style 1 - both sidebar',
        'thumbnails' => 'blog-1-two-sidebar.jpg',
        'positions' => array(
            'position_1',
            'position_10',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'blog-2' => array(
        'title' => 'Blog style 2 - right sidebar',
        'thumbnails' => 'blog-2.jpg',
        'positions' => array(
            'position_1',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'blog-3-one-sidebar' => array(
        'title' => 'Blog style 3 - right sidebar',
        'thumbnails' => 'blog-3-one-sidebar.jpg',
        'positions' => array(
            'position_1',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'blog-3-two-sidebar' => array(
        'title' => 'Blog style 3 - both sidebar',
        'thumbnails' => 'blog-3-two-sidebar.jpg',
        'positions' => array(
            'position_1',
            'position_10',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'single-1-left-sidebar' => array(
        'title' => 'Single style 1 - Left Sidebar',
        'thumbnails' => 'single-1-left-sidebar.jpg',
        'positions' => array(
            'position_10',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'single-1-right-sidebar' => array(
        'title' => 'Single style 1 - Right Sidebar',
        'thumbnails' => 'single-1-right-sidebar.jpg',
        'positions' => array(
            'position_1',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'single-1-two-sidebar' => array(
        'title' => 'Single style 1 - both Sidebar',
        'thumbnails' => 'single-1-two-sidebar.jpg',
        'positions' => array(
            'position_1',
            'position_10',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'single-1-full-width' => array(
        'title' => 'Single style 1 - Full Width',
        'thumbnails' => 'single-1-full-width.jpg',
        'positions' => array(
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'single-2-right-sidebar' => array(
        'title' => 'Single style 2 - Right Sidebar',
        'thumbnails' => 'single-2-right-sidebar.jpg',
        'positions' => array(
            'position_1',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'page-1-left-sidebar' => array(
        'title' => 'Page Left Sidebar',
        'thumbnails' => 'single-1-left-sidebar.jpg',
        'positions' => array(
            'position_10',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'page-2-right-sidebar' => array(
        'title' => 'Page Right Sidebar',
        'thumbnails' => 'single-1-right-sidebar.jpg',
        'positions' => array(
            'position_1',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'page-3-two-sidebar' => array(
        'title' => 'Page Two Sidebars',
        'thumbnails' => 'single-1-two-sidebar.jpg',
        'positions' => array(
            'position_1',
            'position_10',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'page-4-full-width' => array(
        'title' => 'Page without sidebar',
        'thumbnails' => 'single-1-full-width.jpg',
        'positions' => array(
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'search-left-sidebar' => array(
        'title' => 'Search - Left Sidebar',
        'thumbnails' => 'search-left-sidebar.jpg',
        'positions' => array(
            'position_10',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'search-right-sidebar' => array(
        'title' => 'Search - Right Sidebar',
        'thumbnails' => 'search-right-sidebar.jpg',
        'positions' => array(
            'position_1',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'search-two-sidebar' => array(
        'title' => 'Search Two Sidebar',
        'thumbnails' => 'search-two-sidebar.jpg',
        'positions' => array(
            'position_1',
            'position_10',
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
    'error-404' => array(
        'title' => '404 Page',
        'thumbnails' => 'error-404.jpg',
        'positions' => array(
            'position_6',
            'position_7',
            'position_8',
            'position_9'
        ),
    ),
);

$KOPA_SIDEBAR_POSITIONS = array(
    'position_1' => array('title' => 'Widget Area 1'),
    'position_2' => array('title' => 'Widget Area 2'),
    'position_3' => array('title' => 'Widget Area 3'),
    'position_4' => array('title' => 'Widget Area 4'),
    'position_5' => array('title' => 'Widget Area 5'),
    'position_6' => array('title' => 'Widget Area 6'),
    'position_7' => array('title' => 'Widget Area 7'),
    'position_8' => array('title' => 'Widget Area 8'),
    'position_9' => array('title' => 'Widget Area 9'),
    'position_10' => array('title' => 'Widget Area 10'),
    'position_11' => array('title' => 'Widget Area 11'),
    'position_12' => array('title' => 'Widget Area 12'),
    'position_13' => array('title' => 'Widget Area 13'),
    'position_14' => array('title' => 'Widget Area 14'),
);

$KOPA_TEMPLATE_HIERARCHY = array(
    'home' => array(
        'title' => 'Home',
        'layout' => array('blog-1-left-sidebar', 'blog-1-right-sidebar', 'blog-1-two-sidebar', 'blog-2', 'blog-3-one-sidebar', 'blog-3-two-sidebar')
    ),
    'front-page' => array(
        'title' => 'Front Page',
        'layout' => array('front-page-right-sidebar', 'front-page-full-width')
    ),
    'post' => array(
        'title' => 'Post',
        'layout' => array('single-1-left-sidebar', 'single-1-right-sidebar', 'single-1-two-sidebar', 'single-1-full-width', 'single-2-right-sidebar')
    ),
    'page' => array(
        'title' => 'Page',
        'layout' => array('page-1-left-sidebar', 'page-2-right-sidebar', 'page-3-two-sidebar', 'page-4-full-width', 'front-page-full-width', 'front-page-right-sidebar')
    ),
    'taxonomy' => array(
        'title' => 'Taxonomy',
        'layout' => array('blog-1-left-sidebar', 'blog-1-right-sidebar', 'blog-1-two-sidebar', 'blog-2', 'blog-3-one-sidebar', 'blog-3-two-sidebar')
    ),
    'search' => array(
        'title' => 'Search',
        'layout' => array('search-left-sidebar', 'search-right-sidebar', 'search-two-sidebar')
    ),
    'archive' => array(
        'title' => 'Archive',
        'layout' => array('blog-1-left-sidebar', 'blog-1-right-sidebar', 'blog-1-two-sidebar', 'blog-2', 'blog-3-one-sidebar', 'blog-3-two-sidebar')
    ),
    '_404' => array(
        'title' => '404',
        'layout' => array('error-404')
    ),
);

$KOPA_SETTING = array(
    'home' => array(
        'layout_id' => 'blog-2',
        'sidebars' => array(
            'sidebar_1',
            'sidebar_6',
            'sidebar_7',
            'sidebar_8',
            'sidebar_9'
        ),
    ),
    'front-page' => array(
        'layout_id' => 'front-page-right-sidebar',
        'sidebars' => array(
            'sidebar_1',
            'sidebar_2',
            'sidebar_3',
            'sidebar_4',
            'sidebar_5',
            'sidebar_14',
            'sidebar_6',
            'sidebar_7',
            'sidebar_8',
            'sidebar_9'
        ),
    ),
    'post' => array(
        'layout_id' => 'single-1-right-sidebar',
        'sidebars' => array(
            'sidebar_1',
            'sidebar_6',
            'sidebar_7',
            'sidebar_8',
            'sidebar_9'
        ),
    ),
    'page' => array(
        'layout_id' => 'page-2-right-sidebar',
        'sidebars' => array(
            'sidebar_1',
            'sidebar_6',
            'sidebar_7',
            'sidebar_8',
            'sidebar_9'
        ),
    ),
    'taxonomy' => array(
        'layout_id' => 'blog-1-right-sidebar',
        'sidebars' => array(
            'sidebar_1',
            'sidebar_6',
            'sidebar_7',
            'sidebar_8',
            'sidebar_9'
        ),
    ),
    'search' => array(
        'layout_id' => 'search-right-sidebar',
        'sidebars' => array(
            'sidebar_1',
            'sidebar_6',
            'sidebar_7',
            'sidebar_8',
            'sidebar_9'
        ),
    ),
    'archive' => array(
        'layout_id' => 'blog-1-right-sidebar',
        'sidebars' => array(
            'sidebar_1',
            'sidebar_6',
            'sidebar_7',
            'sidebar_8',
            'sidebar_9'
        ),
    ),
    '_404' => array(
        'layout_id' => 'error-404',
        'sidebars' => array(
            'sidebar_6',
            'sidebar_7',
            'sidebar_8',
            'sidebar_9'
        ),
    ),
);

$KOPA_SETTING = get_option('kopa_setting', $KOPA_SETTING);

$KOPA_SIDEBARS = array(
    'sidebar_hide' => '-- None --',
    'sidebar_1' => 'Sidebar 1',
    'sidebar_2' => 'Sidebar 2',
    'sidebar_3' => 'Sidebar 3',
    'sidebar_4' => 'Sidebar 4',
    'sidebar_5' => 'Sidebar 5',
    'sidebar_6' => 'Sidebar 6',
    'sidebar_7' => 'Sidebar 7',
    'sidebar_8' => 'Sidebar 8',
    'sidebar_9' => 'Sidebar 9',
    'sidebar_10' => 'Sidebar 10',
    'sidebar_11' => 'Sidebar 11',
    'sidebar_12' => 'Sidebar 12',
    'sidebar_13' => 'Sidebar 13',
    'sidebar_14' => 'Sidebar 14',
);

$KOPA_SIDEBARS = get_option('kopa_sidebar', $KOPA_SIDEBARS);

if (!empty($KOPA_SIDEBARS)) {
    foreach ($KOPA_SIDEBARS as $key => $value) {
        if ('sidebar_hide' != $key) {
            register_sidebar(array(
                'name' => $value,
                'id' => $key,
                'before_widget' => '<div id="%1$s" class="widget clearfix %2$s">',
                'after_widget' => '</div>',
                'before_title' => '<h4 class="widget-title clearfix"><span>',
                'after_title' => '</span></h4>'
            ));
        }
    }
}
