123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- require_once(__DIR__.SLASH.'..'.SLASH.'hackpoint'.SLASH.'types'.SLASH.'ReadmeType.class.php');
- class GitType extends ReadmeType{
- public static function manifest(){
- return array(
- 'uid' => 'git',
- 'label' => 'Dépot git',
- 'icon' => 'fab fa-git-square',
- 'color' => '#ffffff',
- 'background' => '#bd2c00',
- 'description' => 'Dépot git associé',
- 'fromExtension' => array('.git'),
- 'toExtension' => '.zip',
- 'default' => '',
- );
- }
- /* EDITION */
- public static function toHtml($resource,$sketch=null){
- $infos = self::manifest();
-
-
- ob_start();
- require_once(__DIR__.SLASH.'git.sheet.php');
- $html = ob_get_clean();
- return array(
- 'html'=>$html
- );
- }
- //Export vers un fichier brut
- public static function toFile($resource){
- $infos = self::manifest();
- return array(
- 'name'=> slugify($resource->label).'.'.$infos['toExtension'],
- 'content' => html_entity_decode($resource->content)
- );
- }
-
- }
- ?>
|