<commit_before><?php if(!defined('GX_LIB')) die("Direct Access Not Allowed!");
/**
* GeniXCMS - Content Management System
* 
* PHP Based Content Management System and Framework
*
* @package GeniXCMS
* @since 0.0.1 build date 20141006
* @version 0.0.2
* @link https://github.com/semplon/GeniXCMS
* @author <NAME> (www.metalgenix.com)
* @copyright 2014-2015 <NAME>
* @license http://www.opensource.org/licenses/mit-license.php MIT
*
*/

/**
* Control Class
*
* This class will proccess the controller
* 
* @author <NAME> (www.metalgenix.com)
* @since 0.0.1
*/
class Control
{

    public function __construct () {

    }

    /**
    * Control Handler Function.
    * This is the loader of the controller. This function is not necessary. 
    * Controller can be loaded directly below. Will be removed on the next
    * update.
    *
    * @param string $vars
    *
    * @author <NAME> (www.metalgenix.com)
    * @since 0.0.1 
    */
    public static function handler($vars) {
            self::$vars();
    }

    /**
    * Control Frontend Inclusion Function.
    * This will include the controller at the Frontend directory.
    *
    * @param string $vars
    *
    * @author <NAME> (www.metalgenix.com)
    * @since 0.0.1 
    */
    public static function incFront($vars) {
        $file = GX_PATH.'/inc/lib/Control/Frontend/'.$vars.'.control.php';
        if ( file_exists($file) ) {
            # code...
            include($file);
        }else{
            self::error('404');
        }
        
    }

    /**
    * Control Backend Inclusion Function.
    * This will include the controller at the Backend directory.
    *
    * @param string $vars
    *
    * @author <NAME>anto (www.metalgenix.com)
    * @since 0.0.1 
    */
    public static function incBack($vars) {
        $file = GX_PATH.'/inc/lib/Control/Backend/'.$vars.'.control.php';
        if ( file_exists($file) ) {
            # code...
            include($file);
        }else{
            self::error('404');
        }
    }

    /**
    * Control Frontend Handler Function.
    * This will handle the controller which file will be included at the Frontend
    * controller.
    *
    * @author <NAME> (www.metalgenix.com)
    * @since 0.0.1 
    */
    public static function frontend() {
        
        if($_GET){
            //print_r($_GET);
            $arr = array ('post','page', 'cat', 'mod', 'sitemap', 'rss');

            foreach ($_GET as $k => $v) {
                # code...
                //echo $k;
                if(in_array($k, $arr)){
                    self::incFront($k);
                }elseif($k == "error"){
                    self::error($v);
                }elseif(!in_array($k, $arr) && $k != 'paging'){
                    self::error('404');
                }else{
                    self::incFront('default');
                }
            }
            
        }else{
            self::incFront('default');
        }
        
    }

    /**
    * Control Backend Handler Function.
    * This will handle the controller which file will be included at the Backend
    * controller.
    *
    * @author <NAME> (www.metalgenix.com)
    * @since 0.0.1 
    */
    public static function backend($vars="") {
        //if(isset($_GET['post'])) {<commit_msg>fix front end controller handler<commit_after><?php if(!defined('GX_LIB')) die("Direct Access Not Allowed!");
/**
* GeniXCMS - Content Management System
* 
* PHP Based Content Management System and Framework
*
* @package GeniXCMS
* @since 0.0.1 build date 20141006
* @version 0.0.2
* @link https://github.com/semplon/GeniXCMS
* @author <NAME> (www.metalgenix.com)
* @copyright 2014-2015 <NAME>
* @license http://www.opensource.org/licenses/mit-license.php MIT
*
*/

/**
* Control Class
*
* This class will proccess the controller
* 
* @author <NAME> (www.metalgenix.com)
* @since 0.0.1
*/
class Control
{

    public function __construct () {

    }

    /**
    * Control Handler Function.
    * This is the loader of the controller. This function is not necessary. 
    * Controller can be loaded directly below. Will be removed on the next
    * update.
    *
    * @param string $vars
    *
    * @author <NAME> (www.metalgenix.com)
    * @since 0.0.1 
    */
    public static function handler($vars) {
            self::$vars();
    }

    /**
    * Control Frontend Inclusion Function.
    * This will include the controller at the Frontend directory.
    *
    * @param string $vars
    *
    * @author <NAME> (www.metalgenix.com)
    * @since 0.0.1 
    */
    public static function incFront($vars) {
        $file = GX_PATH.'/inc/lib/Control/Frontend/'.$vars.'.control.php';
        if ( file_exists($file) ) {
            # code...
            include($file);
        }else{
            self::error('404');
        }
        
    }

    /**
    * Control Backend Inclusion Function.
    * This will include the controller at the Backend directory.
    *
    * @param string $vars
    *
    * @author <NAME> (www.metalgenix.com)
    * @since 0.0.1 
    */
    public static function incBack($vars) {
        $file = GX_PATH.'/inc/lib/Control/Backend/'.$vars.'.control.php';
        if ( file_exists($file) ) {
            # code...
            include($file);
        }else{
            self::error('404');
        }
    }

    /**
    * Control Frontend Handler Function.
    * This will handle the controller which file will be included at the Frontend
    * controller.
    *
    * @author <NAME> (www.metalgenix.com)
    * @since 0.0.1 
    */
    public static function frontend() {
        
        if($_GET){
            //print_r($_GET);
            $arr = array ('post','page', 'cat', 'mod', 'sitemap', 'rss','pay','paidorder','cancelorder');
            $get =0;
            foreach ($_GET as $k => $v) {
                    # code...
                    //echo $k;
                if (in_array($k,$arr ) || $k == 'paging') {
                    $get = $get+1;
                }else{
                    $get = $get;
                }


            }
            //echo $get;
            if ($get>0) {
                foreach ($_GET as $k => $v) {
                    if(in_array($k, $arr)){
                        self::incFront($k);
                    }elseif($k == "error"){
                        self::error($v);
                    }elseif(!in_array($k, $arr) && $k != 'paging'){
                        //self::error('404');
                    }else{
                        self::incFront('default');
                    }
                }
            }else{
                self::error('404');
            }
            
            
        }else{
            self::incFront('default');
        }
        
    }

    /**
    * Control Backend Handler Function.
    * This will handle the controller which file will be included at the Backend
    * controller.
    *
    * @author <NAME> (www.metalgenix.com)
    * @since 0.0.1 
    */
    public static function backend($vars="") {
        //if(isset($_GET['post'])) {
{'fraction_non_alphanumeric': 0.14529671267966415, 'fraction_numerical': 0.014800056923295859, 'mean_word_length': 1.6611132146914047, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 16, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6854991', 'n_tokens_mistral': 2227, 'n_tokens_neox': 2093, 'n_words': 524}