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: type:
label: 'Language: %value%' label: 'Language: %value%'
choice: choice:
xml: 'HTML/XML' html: 'HTML'
xml: 'XML'
css: 'CSS' css: 'CSS'
javascript: 'JAVASCRIPT' javascript: 'JAVASCRIPT'
php: 'PHP' php: 'PHP'

View file

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

View file

@ -40,7 +40,7 @@ class Controller
'history' => $history, 'history' => $history,
'commit' => $commit, 'commit' => $commit,
'raw_content' => $content, '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) public function createAction(Request $request, Application $app)
{ {
$data = array( $data = array(
'type' => 'xml', 'type' => 'html',
'cipher' => 'no', 'cipher' => 'no',
); );

View file

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

View file

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