diff --git a/onyx/include/admin/exercice.php b/onyx/include/admin/exercice.php index 3a925efb..fa6858cd 100644 --- a/onyx/include/admin/exercice.php +++ b/onyx/include/admin/exercice.php @@ -5,9 +5,16 @@ if(!defined('ONYX')) exit; $p = $out[0]; if (isset($p[2])) - $template->assign("theme", $p[2]); +{ + $tmp = explode("-", $p[2]); + $id = intval($tmp[0]); + if ($id == 0) + return "404"; + $theme = new Theme($id); + $template->assign("theme", $theme); +} if (isset($p[3])) - $template->assign("ex", $p[3]); + $template->assign("ex", new Exercice($p[3], $theme)); -return "admin/exercice"; +return SALT_ADMIN."/exercice"; diff --git a/onyx/tpl/bootstrap/admin/exercice.tpl b/onyx/tpl/bootstrap/admin/exercice.tpl index 1537536f..605034b2 100644 --- a/onyx/tpl/bootstrap/admin/exercice.tpl +++ b/onyx/tpl/bootstrap/admin/exercice.tpl @@ -1,7 +1,15 @@ {extends file="admin/layout.tpl"} {block name=content}

- Theme: {$theme}
- Exercice: {$ex} + Theme: {$theme->name}
+ {if isset($ex)} + Exercice: {$ex->id} + {else} +

+ {/if}

{/block} diff --git a/onyx/tpl/bootstrap/admin/themes.tpl b/onyx/tpl/bootstrap/admin/themes.tpl index 150ded87..86c9bf2b 100644 --- a/onyx/tpl/bootstrap/admin/themes.tpl +++ b/onyx/tpl/bootstrap/admin/themes.tpl @@ -19,10 +19,10 @@ Exporter - {$t->name} + {$t->name} FIXME