<commit_before><?php

/**
 * Copyright 2012 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

class Front extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		$this->load->helper(array('subdomain', 'url'));
		$this->load->database();
		if (get_subdomain()) {
			log_message('debug', 'front controller loaded with subdomain -> sending 404');
			show_404();
		}
	}

	public function index()
	{
		$default_library_scripts = array(
			'/libraries/enketo-core/lib/jquery.min.js',
			'/libraries/enketo-core/lib/bootstrap.min.js',
			'/libraries/enketo-core/lib/modernizr.min.js'
		);
		$default_main_scripts = array(
			'/libraries/enketo-core/src/js/utils.js',
			'/js-source/gui.js',
			'/js-source/connection.js',
			'/js-source/front.js'
		);
		$data = array(
			'offline'			=> FALSE, 
			'title_component'	=> 'home', 
			'linked_with'		=> $this->config->item('integration_with_url'),
			'robots'     		=> TRUE//,
			//'number_launched'	=> $this->_get_db_number_launched()
		);


		 $data['scripts'] = (ENVIRONMENT === 'production') 
            ? array(array('src' => '/build/js/front-combined.min.js'))
            : array(array('src' => '/lib/bower-components/requirejs/require.js', 'data-main' => '/src/js/main-front.js'));
		
		if (strlen($this->config->item('integrated')) > 0) {
			$data['stylesheets'] = array(
				array( 'href' => '/build/css/empty-front.css', 'media' => 'screen'),
			);
			$this->load->view('front_view_bare', $data);
		} else {
			$data['stylesheets'] = array(
				array( 'href' => '/build/css/front.css', 'media' => 'screen')
			);
			$this->load->view('private_views/front_view', $data);
		}	
	}

	/*
	public function get_number_launched() {
		echo $this->_get_number_launched();
	}

	private function _get_number_launched() {<commit_msg>fixed: home page title<commit_after><?php

/**
 * Copyright 2012 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

class Front extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		$this->load->helper(array('subdomain', 'url'));
		$this->load->database();
		if (get_subdomain()) {
			log_message('debug', 'front controller loaded with subdomain -> sending 404');
			show_404();
		}
	}

	public function index()
	{
		$default_library_scripts = array(
			'/libraries/enketo-core/lib/jquery.min.js',
			'/libraries/enketo-core/lib/bootstrap.min.js',
			'/libraries/enketo-core/lib/modernizr.min.js'
		);
		$default_main_scripts = array(
			'/libraries/enketo-core/src/js/utils.js',
			'/js-source/gui.js',
			'/js-source/connection.js',
			'/js-source/front.js'
		);
		$data = array(
			'offline'			=> FALSE, 
			'title_component'	=> '', 
			'linked_with'		=> $this->config->item('integration_with_url'),
			'robots'     		=> TRUE//,
			//'number_launched'	=> $this->_get_db_number_launched()
		);


		 $data['scripts'] = (ENVIRONMENT === 'production') 
            ? array(array('src' => '/build/js/front-combined.min.js'))
            : array(array('src' => '/lib/bower-components/requirejs/require.js', 'data-main' => '/src/js/main-front.js'));
		
		if (strlen($this->config->item('integrated')) > 0) {
			$data['stylesheets'] = array(
				array( 'href' => '/build/css/empty-front.css', 'media' => 'screen'),
			);
			$this->load->view('front_view_bare', $data);
		} else {
			$data['stylesheets'] = array(
				array( 'href' => '/build/css/front.css', 'media' => 'screen')
			);
			$this->load->view('private_views/front_view', $data);
		}	
	}

	/*
	public function get_number_launched() {
		echo $this->_get_number_launched();
	}

	private function _get_number_launched() {
{'fraction_non_alphanumeric': 0.17281553398058253, 'fraction_numerical': 0.006472491909385114, 'mean_word_length': 3.5719921104536487, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1361125', 'n_tokens_mistral': 1725, 'n_tokens_neox': 1532, 'n_words': 338}