<?php

defined('BASEPATH') or exit('No direct script access allowed');

class Themes extends AdminController
{
    public function __construct()
    {
        parent::__construct();
        $this->load->model('propertybase_model');
        hooks()->do_action('propertybase_init');
    }

    public function index()
    {
        if (!has_permission('propertybase_themes', '', 'view')) {
            access_denied('propertybase');
        }

        $data['title'] = _l('propertybase_landing_page_themes');
        $this->load->view('admin/themes/themes', $data);
    }

    public function activate_theme($theme)
    {
        update_option('propertybase_active_theme', $theme);
        redirect($_SERVER['HTTP_REFERER']);
    }
}