<?php

class Pelican extends CI_Controller {
    private function is_valid_file($rel_path = '/', $file_html = 'home.html')
    {
        $abs_path = APPPATH.$rel_path.$file_html;
        if (file_exists($abs_path))
            return true;

        return false;
    }

    public function index()
    {
        $this->load->view('index.html');
    }

    public function view($file_name = 'home')
    {
        $file_html = $file_name.'.html';
        if ($this->is_valid_file('views/blog/', $file_html))
        {
            $this->load->view('blog/'.$file_html);
        }
        else if ($this->is_valid_file('views/category/', $file_html))
        {
            $this->load->view('category/'.$file_html);
        }
        else if ($this->is_valid_file('views/page/', $file_html))
        {
            $this->load->view('page/'.$file_html);
        }
        else if ($this->is_valid_file('views/', $file_html))
        {
            $this->load->view($file_html);
        }
        else
        {
            $this->index();
        }
    }
}
