mirror of
https://gitnet.fr/deblan/gist.git
synced 2021-08-14 08:30:49 +02:00
Default type
This commit is contained in:
parent
f15f7c383c
commit
088c9ebdcd
@ -38,7 +38,8 @@ form:
|
||||
type:
|
||||
label: 'Language: %value%'
|
||||
choice:
|
||||
xml: 'HTML/XML'
|
||||
html: 'HTML'
|
||||
xml: 'XML'
|
||||
css: 'CSS'
|
||||
javascript: 'JAVASCRIPT'
|
||||
php: 'PHP'
|
||||
|
@ -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'
|
||||
|
@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ class EditController extends Controller
|
||||
public function createAction(Request $request, Application $app)
|
||||
{
|
||||
$data = array(
|
||||
'type' => 'xml',
|
||||
'type' => 'html',
|
||||
'cipher' => 'no',
|
||||
);
|
||||
|
||||
|
@ -71,11 +71,12 @@ class CreateGistForm extends AbstractForm
|
||||
protected function getTypes()
|
||||
{
|
||||
$types = array(
|
||||
'xml' => '',
|
||||
'html' => '',
|
||||
'css' => '',
|
||||
'javascript' => '',
|
||||
'php' => '',
|
||||
'sql' => '',
|
||||
'xml' => '',
|
||||
'yaml'=> '',
|
||||
'perl' => '',
|
||||
'c' => '',
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user