<commit_before><?php
class Page_Filestore_FileAdmin extends Page {
	public $controller='Controller_Filestore_File';
	function init(){
		parent::init();
		$this->api->stickyGET('tab');
		switch($_GET['tab']){
			case null:
			case 'file':
				$this->controller='Controller_Filestore_File';
				break;
			case 'volume':
				$this->controller='Controller_Filestore_Volume';
				break;
			case 'type':
				$this->controller='Controller_Filestore_Type';
				break;
		}
	}
	function initMainPage(){
		/*
		$g=$this->add('MVCGrid');
		$c=$g->add('Controller_Filestore_File');
		$g->setController($c);

		*/

		$f=$this->add('Form');
		$f->addField('upload','Upload_test')->setController($this->controller)->debug();

		$v=$this->add('View_Columns');
		$g=$v->addColumn(5);

        $g->add('CRUD')->setModel('Filestore_Volume',null,array('name','dirname','stored_files_cnt','enabled'));
        /*
		$c=$g->add('Controller_Filestore_Volume');
		$c->setActualFields(array('name','dirname','stored_files_cnt','enabled'));
		$g->setController($c);
		$g->addColumnPlain('expander_widget', 'editvolume', $this->read_only?'view':'Edit');
		$g->addButton('Add')->js('click')->univ()->dialogURL('Add new',
				$this->api->getDestinationURL('./editvolume'));
		$g->addColumnPlain('confirm','deletevolume','Delete');
		if($_GET['deletevolume']){
			$c->loadData($_GET['deletevolume']);
			$c->delete();
			$g->js(null,$g->js()->univ()->successMessage('Record deleted'))->reload()->execute();
		}
		if($_GET['edit']){
			$this->js()->univ()->location($this->api->getDestinationURL($this->returnpage,
						Array('id' => $_GET['edit'])))->execute();
		}

        */

		$g=$v->addColumn(5);

        $g->add('CRUD')->setModel('Filestore_Type',null,array('name','mime_type'));

        /*
		$c=$g->add('Controller_Filestore_Type');
		$c->setActualFields(array('name','mime_type','extends'));
		$g->setController($c);
		$g->addColumnPlain('expander_widget', 'edittype', 'Edit');
		$g->addButton('Add')->js('click')->univ()->dialogURL('Add new',$this->api->getDestinationURL('./edittype'));
		$g->addColumnPlain('confirm','deletetype','Delete');
		if($_GET['deletetype']){
			$c->loadData($_GET['deletetype']);
			$c->delete();
			$g->js(null,$g->js()->univ()->successMessage('Record deleted'))->reload()->execute();
		}
		if($_GET['edit']){
			$this->js()->univ()->location($this->api->getDestinationURL($this->returnpage,
						Array('id' => $_GET['edit'])))->execute();
		}


		$_GET['tab']='';$this->api->stickyGET('tab');
        */

		$g=$this->add('CRUD')->setModel('Filestore_File');

        /*
		$c=$g->add('Controller_Filestore_File');
		
		if($this->grid_actual_fields)
			$c->setActualFields($this->grid_actual_fields);

		$g->setController($c);
		$g->addPaginator(50);

		if($this->allow_edit)
			$g->addColumnPlain('expander_widget', 'edit', $this->read_only?'view':'edit');
		if($this->allow_add){
			$g->addButton('Add')->js('click')->univ()->dialogURL('Add new',$this->api->getDestinationURL('./upload'));
		}
		if($this->allow_delete){
			$g->addColumnPlain('confirm','delete');
			if($_GET['delete']){
				$c->loadData($_GET['delete']);
				$c->delete();
				$g->js(null,$g->js()->univ()->successMessage('Record deleted'))->reload()->execute();
			}
		}
		
		
		if($this->allow_edit){
			if($_GET['edit']){
				$this->js()->univ()->location($this->api->getDestinationURL($this->returnpage,
							Array('id' => $_GET['edit'])))->execute();
			}
		}
        */



	}
    /*
	function page_editvolume(){
		$this->c=($this->add($this->controller='Controller_Filestore_Volume'));
		return parent::page_edit();
	}
	function page_edittype(){
		$this->c=($this->add($this->controller='Controller_Filestore_Type'));
		return parent::page_edit();
	}
    */
}
<commit_msg>fixes<commit_after><?php
class Page_Filestore_FileAdmin extends Page {
	public $controller='Controller_Filestore_File';
	function init(){
		parent::init();
		$this->api->stickyGET('tab');
		switch($_GET['tab']){
			case null:
			case 'file':
				$this->controller='Controller_Filestore_File';
				break;
			case 'volume':
				$this->controller='Controller_Filestore_Volume';
				break;
			case 'type':
				$this->controller='Controller_Filestore_Type';
				break;
		}
	}
	function initMainPage(){
		/*
		$g=$this->add('MVCGrid');
		$c=$g->add('Controller_Filestore_File');
		$g->setController($c);

		*/

		$f=$this->add('Form');
		$f->addField('upload','Upload_test','Upload new file')->setController($this->controller)->debug();

		$v=$this->add('View_Columns');
		$g=$v->addColumn(5);

		$g->add('H3')->set('Storage Location');
        $g->add('CRUD')->setModel('Filestore_Volume',null,array('name','dirname','stored_files_cnt','enabled'));
        /*
		$c=$g->add('Controller_Filestore_Volume');
		$c->setActualFields(array('name','dirname','stored_files_cnt','enabled'));
		$g->setController($c);
		$g->addColumnPlain('expander_widget', 'editvolume', $this->read_only?'view':'Edit');
		$g->addButton('Add')->js('click')->univ()->dialogURL('Add new',
				$this->api->getDestinationURL('./editvolume'));
		$g->addColumnPlain('confirm','deletevolume','Delete');
		if($_GET['deletevolume']){
			$c->loadData($_GET['deletevolume']);
			$c->delete();
			$g->js(null,$g->js()->univ()->successMessage('Record deleted'))->reload()->execute();
		}
		if($_GET['edit']){
			$this->js()->univ()->location($this->api->getDestinationURL($this->returnpage,
						Array('id' => $_GET['edit'])))->execute();
		}

        */

		$g=$v->addColumn(5);

		$g->add('H3')->set('Allowed Filetypes');
        $g->add('CRUD')->setModel('Filestore_Type',null,array('name','mime_type'));

        /*
		$c=$g->add('Controller_Filestore_Type');
		$c->setActualFields(array('name','mime_type','extends'));
		$g->setController($c);
		$g->addColumnPlain('expander_widget', 'edittype', 'Edit');
		$g->addButton('Add')->js('click')->univ()->dialogURL('Add new',$this->api->getDestinationURL('./edittype'));
		$g->addColumnPlain('confirm','deletetype','Delete');
		if($_GET['deletetype']){
			$c->loadData($_GET['deletetype']);
			$c->delete();
			$g->js(null,$g->js()->univ()->successMessage('Record deleted'))->reload()->execute();
		}
		if($_GET['edit']){
			$this->js()->univ()->location($this->api->getDestinationURL($this->returnpage,
						Array('id' => $_GET['edit'])))->execute();
		}


		$_GET['tab']='';$this->api->stickyGET('tab');
        */

		$g=$this->add('CRUD');$g->setModel('Filestore_File');
		if($g->grid)$g->grid->dq->order('id desc');

        /*
		$c=$g->add('Controller_Filestore_File');
		
		if($this->grid_actual_fields)
			$c->setActualFields($this->grid_actual_fields);

		$g->setController($c);
		$g->addPaginator(50);

		if($this->allow_edit)
			$g->addColumnPlain('expander_widget', 'edit', $this->read_only?'view':'edit');
		if($this->allow_add){
			$g->addButton('Add')->js('click')->univ()->dialogURL('Add new',$this->api->getDestinationURL('./upload'));
		}
		if($this->allow_delete){
			$g->addColumnPlain('confirm','delete');
			if($_GET['delete']){
				$c->loadData($_GET['delete']);
				$c->delete();
				$g->js(null,$g->js()->univ()->successMessage('Record deleted'))->reload()->execute();
			}
		}
		
		
		if($this->allow_edit){
			if($_GET['edit']){
				$this->js()->univ()->location($this->api->getDestinationURL($this->returnpage,
							Array('id' => $_GET['edit'])))->execute();
			}
		}
        */



	}
    /*
	function page_editvolume(){
		$this->c=($this->add($this->controller='Controller_Filestore_Volume'));
		return parent::page_edit();
	}
	function page_edittype(){
		$this->c=($this->add($this->controller='Controller_Filestore_Type'));
		return parent::page_edit();
	}
    */
}

{'fraction_non_alphanumeric': 0.26076742364917777, 'fraction_numerical': 0.0013051422605063951, 'mean_word_length': 5.214922952149229, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 251, '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': '6120866', 'n_tokens_mistral': 3007, 'n_tokens_neox': 2669, 'n_words': 230}