1
0
mirror of https://gitnet.fr/deblan/gist.git synced 2021-08-14 08:30:49 +02:00

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(