<commit_before><?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * Admin/About is the Controller that is executed by accessing "/Admin/About".
 * 
 * @author <NAME>
 */
class About extends Application {

    /**
     * Controller for "Admin/About" page.
     */
    public function index() {
        $this->data['mode'] = 'admin';
        $this->data['pagebody'] = 'admin/about';
        
        // Load current contents of about page into template var 'about'
        $this->data['about'] = file_get_contents('application\views\about.php');
        
        $this->render();
    }
}
<commit_msg>-Added TinyMCE output to About controller. -Added input saving to file.<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * Admin/About is the Controller that is executed by accessing "/Admin/About".
 * 
 * @author <NAME>
 */
class About extends Application {
    
    private static $ABOUT_FILE   = 'application/views/about.php';

    /**
     * Controller for "Admin/About" page.
     */
    public function index() {
        // Check if the form was submitted and if so, save the data
        $this->saveData();
        
        // Setup the rendering configuration
        $this->data['mode'] = 'admin';
        $this->data['pagebody'] = 'admin/about';
        
        // Load current contents of about page into template var 'about'
        $this->data['about'] = file_get_contents(About::$ABOUT_FILE);
        
        // Load TinyMCE
        $this->data['scripts'][] = array('script'=>"//tinymce.cachefly.net/4.1/tinymce.min.js");
        $this->data['components'][] = array('component'=>$this->parser->parse('components/tinymce', array('selector'=>'.editor')));
        
        $this->render();
    }
    
    /**
     * Save the Submitted data if the form was submitted.
     */
    private function saveData() {
        $newData = '';
        
        // If the data was submitted, write it to the file
        if (($newData = $this->input->post('about', true)) != false) {
            file_put_contents(About::$ABOUT_FILE, $newData);
        }
    }
}

{'fraction_non_alphanumeric': 0.153737658674189, 'fraction_numerical': 0.0009402914903620122, 'mean_word_length': 2.4378029079159935, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2635072', 'n_tokens_mistral': 609, 'n_tokens_neox': 599, 'n_words': 164}