<?php
/**
 * Filename: _pages.php
 * Created by: BlogProfitNetwork.Com <marcus@blogprofitnetwork.com> (https://BlogProfitNetwork.Com)
 * Copyright:2018 All Rights Reserved - BlogProfitNetwork.Com <marcus@blogprofitnetwork.com> (https://BlogProfitNetwork.Com)
 *
 * Skype: blogprofitnetwork
 * Email: marcus@blogprofitnetwork.com
 */
defined('_IN_MAIN_MODULE') or die ('ACCESS DENIED');

class clickVoodooV4Pages {
    var $path;
    var $pages = array(
        'main'      => array(
            'title' => 'Main',
            'file'  => 'main.php'
        ),

        'intro'     => array(
            'title' => 'Introduction',
            'file'  => 'introduction.php'
        ),

        'manage'    => array(
            'title' => 'Manage',
            'file'  => 'manage.php'
        ),

        'menus'     => array(
            'title' => 'Menus',
            'file'  => 'menus.php'
        ),

        'update-url'    => array(
            'title' => 'Update',
            'file'  => 'update.url.php'
        )
    );

    function __construct() {
        $this->path = CLICKVOODOOV4_PATH .'tmpl';

        //* init
        add_action('init', array($this, 'init'));
    }

    function init() {
        add_action('admin_menu', array($this, 'adminMenu'));
    }

    function adminMenu() {
        global $submenu;

        add_menu_page(CLICKVOODOOV4_NAME, CLICKVOODOOV4_NAME, 9, CLICKVOODOOV4_CODE, array($this, 'displayPageMain'));
    }

    function displayPageMain() {
        extract ($this->pages['main']);
        include_once ($this->path .'/'. $file);
    }

    function displayPageIntro() {
        extract ($this->pages['intro']);
        include_once ($this->path .'/'. $file);
    }

    function displayPageManage() {
        extract ($this->pages['manage']);
        include_once ($this->path .'/'. $file);
    }

    function displayPageMenus() {
        extract ($this->pages['menus']);
        include_once ($this->path .'/'. $file);
    }

    function displayPageUpdateUrl() {
        extract ($this->pages['update-url']);
        include_once ($this->path .'/'. $file);
    }
}

new clickVoodooV4Pages();
