<commit_before><?php
/**
 * Controller is the customized base controller class.
 * All controller classes for this application should extend from this base class.
 */
class CiiDashboardController extends CiiController
{
	/**
	 * Retrieve assetManager from anywhere without having to instatiate this code
	 * @return CAssetManager
	 */
	public function getAsset()
	{
		return Yii::app()->assetManager->publish(YiiBase::getPathOfAlias('application.modules.dashboard.assets'), true, -1, YII_DEBUG);
	}

	/**
	 * Automatically bind some Javascript black magic!
	 * Since _nearly_ every page has a bunch of javascript, all javascript for a particular controller 
	 * is now wrapped up in modules.dashboard.assets.js.dashboard.<controller>.js
	 *
	 * This makes management of the code _very_ friendly and easy to handle. Additionally, it separates
	 * out the js and the php
	 * 
	 * @param  CAction $action The action we are dealing with
	 * @see CiiController::beforeAction()
	 */
	protected function afterRender($view, &$output)
	{
		Yii::app()->clientScript->registerScriptFile($this->asset.'/js/dashboard/' . $this->id. '.js', CClientScript::POS_END);
		Yii::app()->clientScript->registerScript($this->id.'_'.$this->action->id, '$(document).ready(function() { CiiDashboard.'.Cii::titleize($this->id).'.load'.Cii::titleize($this->action->id).'(); });', CCLientScript::POS_END);
	}

	/**
	 * @return array action filters
	 */
	public function filters()
	{
		return array(
			'accessControl'
		);
	}

	/**
	 * Specifies the access control rules.
	 * This method is used by the 'accessControl' filter.
	 * @return array access control rules
	 */
	public function accessRules()
	{
		return array(
			array('allow',  // allow authenticated admins to perform any action
				'users'=>array('@'),
				'expression'=>'Yii::app()->user->role>=5'
			),
			array('deny',  // deny all users
				'users'=>array('*'),
			),
		);
	}
	
	/**
	 * Params... for?
	 * @var array
	 */
	public $params = array();
    
	/**
	 * @var string the default layout for the controller view. Defaults to '//layouts/column1',
	 * meaning using a single column layout. See 'protected/views/layouts/column1.php'.
	 */
	public $layout='main';
}<commit_msg>comments<commit_after><?php
/**
 * Controller is the customized base controller class.
 * All controller classes for this application should extend from this base class.
 */
class CiiDashboardController extends CiiController
{
	/**
	 * Retrieve assetManager from anywhere without having to instatiate this code
	 * @return CAssetManager
	 */
	public function getAsset()
	{
		return Yii::app()->assetManager->publish(YiiBase::getPathOfAlias('application.modules.dashboard.assets'), true, -1, YII_DEBUG);
	}

	/**
	 * Automatically bind some Javascript black magic!
	 * Since _nearly_ every page has a bunch of javascript, all javascript for a particular controller 
	 * is now wrapped up in modules.dashboard.assets.js.dashboard.<controller>.js
	 *
	 * This makes management of the code _very_ friendly and easy to handle. Additionally, it separates
	 * out the js and the php code
	 *
	 * This deliberately occurs afterRender because script order does matter for the dashboard. This really needs to be dead last
	 */
	protected function afterRender($view, &$output)
	{
		Yii::app()->clientScript->registerScriptFile($this->asset.'/js/dashboard/' . $this->id. '.js', CClientScript::POS_END);
		Yii::app()->clientScript->registerScript($this->id.'_'.$this->action->id, '$(document).ready(function() { CiiDashboard.'.Cii::titleize($this->id).'.load'.Cii::titleize($this->action->id).'(); });', CCLientScript::POS_END);
	}

	/**
	 * @return array action filters
	 */
	public function filters()
	{
		return array(
			'accessControl'
		);
	}

	/**
	 * Specifies the access control rules.
	 * This method is used by the 'accessControl' filter.
	 * @return array access control rules
	 */
	public function accessRules()
	{
		return array(
			array('allow',  // allow authenticated admins to perform any action
				'users'=>array('@'),
				'expression'=>'Yii::app()->user->role>=5'
			),
			array('deny',  // deny all users
				'users'=>array('*'),
			),
		);
	}
	
	/**
	 * Params... for?
	 * @var array
	 */
	public $params = array();
    
	/**
	 * @var string the default layout for the controller view. Defaults to '//layouts/column1',
	 * meaning using a single column layout. See 'protected/views/layouts/column1.php'.
	 */
	public $layout='main';
}
{'fraction_non_alphanumeric': 0.14006514657980457, 'fraction_numerical': 0.001737242128121607, 'mean_word_length': 3.365876777251185, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 45, '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': '3750422', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1300, 'n_words': 393}