<?php

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

    public function public_author($file_name = 'index')
    {
        $file_html = $file_name.'.html';
        if ($this->is_valid_file('views/author/', $file_html))
        {
            $this->load->view('author/'.$file_html);
        }
        else
        {
            header('Location: https://'.$_SERVER['HTTP_HOST']);
        }
    }

    public function public_blog($file_name = 'index')
    {
        $file_html = $file_name.'.html';
        if ($this->is_valid_file('views/blog/', $file_html))
        {
            $this->load->view('blog/'.$file_html);
        }
        else
        {
            header('Location: https://'.$_SERVER['HTTP_HOST']);
        }
    }

    public function public_category($file_name = 'index')
    {
        $file_html = $file_name.'.html';
        if ($this->is_valid_file('views/category/', $file_html))
        {
            $this->load->view('category/'.$file_html);
        }
        else
        {
            header('Location: https://'.$_SERVER['HTTP_HOST']);
        }
    }

    public function public_draft($file_name = 'index')
    {
        $file_html = $file_name.'.html';
        if ($this->is_valid_file('views/blog/draft', $file_html))
        {
            $this->load->view('blog/draft/'.$file_html);
        }
        else
        {
            header('Location: https://'.$_SERVER['HTTP_HOST']);
        }
    }

    public function public_gitles()
    {
        $gerrit_gitles = '/gerrit/plugins/gitiles/';
        header('Location: https://'.$_SERVER['HTTP_HOST'].$gerrit_gitles);
    }

    public function public_page($file_name = 'index')
    {
        $file_html = $file_name.'.html';
        if ($this->is_valid_file('views/page/', $file_html))
        {
            $this->load->view('page/'.$file_html);
        }
        else
        {
            header('Location: https://'.$_SERVER['HTTP_HOST']);
        }
    }

    public function public_root($file_name = 'index')
    {
        $file_html = $file_name.'.html';
        if ($this->is_valid_file('views/', $file_html))
        {
            $this->load->view($file_html);
        }
        else
        {
            header('Location: https://'.$_SERVER['HTTP_HOST']);
        }
    }
}
