forked from deblan/gist
Default type
This commit is contained in:
parent
f15f7c383c
commit
088c9ebdcd
|
@ -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'
|
||||||
|
|
|
@ -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'
|
||||||
|
|
|
@ -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),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -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' => '',
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue