1
0
Fork 0
forked from deblan/gist

Default type

This commit is contained in:
Simon Vieille 2015-05-09 12:30:33 +02:00
parent f15f7c383c
commit 088c9ebdcd
6 changed files with 18 additions and 6 deletions

View file

@ -38,7 +38,8 @@ form:
type:
label: 'Language: %value%'
choice:
xml: 'HTML/XML'
html: 'HTML'
xml: 'XML'
css: 'CSS'
javascript: 'JAVASCRIPT'
php: 'PHP'

View file

@ -18,7 +18,7 @@ gist:
history: 'Révision(s)'
raw: 'RAW'
download: 'Télécharger'
fork: 'Clôner'
clone: 'Clôner'
date:
format: 'd/m/Y H\hi s\s'
@ -38,7 +38,8 @@ form:
type:
label: 'Langage : %value%'
choice:
xml: 'HTML/XML'
html: 'HTML'
xml: 'XML'
css: 'CSS'
javascript: 'JAVASCRIPT'
php: 'PHP'

View file

@ -40,7 +40,7 @@ class Controller
'history' => $history,
'commit' => $commit,
'raw_content' => $content,
'content' => $app['gist']->highlight($gist->getType(), $content),
'content' => $app['gist']->highlight($gist->getGeshiType(), $content),
);
}

View file

@ -19,7 +19,7 @@ class EditController extends Controller
public function createAction(Request $request, Application $app)
{
$data = array(
'type' => 'xml',
'type' => 'html',
'cipher' => 'no',
);

View file

@ -71,11 +71,12 @@ class CreateGistForm extends AbstractForm
protected function getTypes()
{
$types = array(
'xml' => '',
'html' => '',
'css' => '',
'javascript' => '',
'php' => '',
'sql' => '',
'xml' => '',
'yaml'=> '',
'perl' => '',
'c' => '',

View file

@ -26,6 +26,15 @@ class Gist extends BaseGist
$this->setFile(uniqid());
}
public function getGeshiType()
{
$data = array(
'html' => 'xml',
);
return str_replace(array_keys($data), array_values($data), $this->getType());
}
public function getTypeAsExtension()
{
$data = array(