PHPType.class.php 899 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. require_once(__DIR__.SLASH.'ReadmeType.class.php');
  3. class PHPType extends ReadmeType{
  4. public static function manifest(){
  5. return array(
  6. 'uid' => 'php',
  7. 'label' => 'PHP',
  8. 'icon' => 'fab fa-php',
  9. 'color' => '#ffffff',
  10. 'background' => '#8892BF',
  11. 'description' => 'Fichier contenant du langage PHP',
  12. 'fromExtension' => array('php','php5'),
  13. 'toExtension' => 'php',
  14. 'default' => '<?php
  15. echo "Hello buddy :p";
  16. ?>',
  17. );
  18. }
  19. /* EDITION */
  20. public static function toHtml($resource,$sketch=null){
  21. $infos = self::manifest();
  22. return array(
  23. 'html'=>'<textarea id="content" onblur="hackpoint_resource_save_content()" class="arduino-text">'.$resource->content.'</textarea>',
  24. 'javascript' => "
  25. hackpoint_resource_mirrorify('.arduino-text',{
  26. mode : 'php',
  27. lineNumbers : true,
  28. theme : 'monokai',
  29. readOnly : false
  30. });
  31. "
  32. );
  33. }
  34. }
  35. ?>