<?php
require_once(__DIR__.SLASH.'ReadmeType.class.php');
class PHPType extends ReadmeType{

	public static function manifest(){
		return array(
			'uid' => 'php',
			'label' => 'PHP',
			'icon' => 'fab fa-php',
			'color' => '#ffffff',
			'background' => '#8892BF',
			'description' => 'Fichier contenant du langage PHP',
			'fromExtension' => array('php','php5'),
			'toExtension' => 'php',
			'default' => '<?php 
echo "Hello buddy :p"; 
?>',

		);
	}

	/* EDITION */
	public static function toHtml($resource,$sketch=null){
		$infos = self::manifest();
		return array(
			'html'=>'<textarea id="content" onblur="hackpoint_resource_save_content()" class="arduino-text">'.$resource->content.'</textarea>',
			'javascript' => "
				hackpoint_resource_mirrorify('.arduino-text',{
					mode : 'php',	
					lineNumbers : true,
					theme : 'monokai',
					readOnly : false
				});
			"
		);
	}


	
}
?>