<?php

class Discord extends CodonModule    {

    public function HTMLHead()
    {
        $this->set('sidebar', 'Discord/sidebar.php');
    }

    public function NavBar()
    {
        echo '<li><a href="'.SITE_URL.'/admin/index.php/Discord">Discord</a></li>';
    }

    public function index() {

    	$this->render('Discord/index.php');
    }

    public function single() {
    	$this->render('Discord/single.php');
    }

      public function deliver() {
     	if($this->post->message != '' && strlen($this->post->message) > 5) {
     		$this->render('Discord/deliver.php');
     	} else {
     		$this->set('message', 'Error, please enter a proper notification to deliver!');
     		$this->show('core_error.php');
     		$this->single();
     	}

    }

    public function detailed() {
    	$this->render('Discord/detailed.php');
    }

      public function deliver_detailed() {
      	if($this->post->message != '' && $this->post->title != '' && $this->post->description != '') {
          
     		$this->render('Discord/deliver_detailed.php');
     	} else {
     		$this->set('message', 'Error, please enter all requied values first!');
     		$this->show('core_error.php');
     		$this->detailed();
     	}

    }


    public function settings() {

    	$this->render('Discord/settings.php');
    }


}
