Add a simple page for admin/exercice

This commit is contained in:
Li Chen 2013-11-28 22:03:27 +01:00
parent 655842bb3a
commit a6ad7597c8
4 changed files with 66 additions and 43 deletions

View File

@ -41,6 +41,9 @@ if ($n && $p[0] == SALT_ADMIN)
else else
$cmpstr = $p[1]; $cmpstr = $p[1];
if (strpos($cmpstr, 'ex/') === 0)
$page = require("admin/exercice.php");
else
switch($cmpstr) switch($cmpstr)
{ {
case "certificate": case "certificate":

View File

@ -0,0 +1,13 @@
<?php
if(!defined('ONYX')) exit;
$p = $out[0];
if (isset($p[2]))
$template->assign("theme", $p[2]);
if (isset($p[3]))
$template->assign("ex", $p[3]);
return "admin/exercice";

View File

@ -0,0 +1,7 @@
{extends file="admin/layout.tpl"}
{block name=content}
<p>
Theme: {$theme} </br>
Exercice: {$ex}
</p>
{/block}

View File

@ -34,10 +34,10 @@
<li{if $menu_where == "themes"} class="active"{/if}><a href="/{$SALT_ADMIN}/themes">Thèmes</a></li> <li{if $menu_where == "themes"} class="active"{/if}><a href="/{$SALT_ADMIN}/themes">Thèmes</a></li>
{foreach from=$themes item=t} {foreach from=$themes item=t}
<li class="dropdown{if $menu_where == $t->get_name()} active{/if}"> <li class="dropdown{if $menu_where == $t->get_name()} active{/if}">
<a href="/{$SALT_ADMIN}/{$t->get_id()}-{$t->get_name()}" class="dropdown-toggle" data-toggle="dropdown">{$t->get_name()} <b class="caret"></b></a> <a href="/{$SALT_ADMIN}/ex/{$t->get_id()}-{$t->get_name()}" class="dropdown-toggle" data-toggle="dropdown">{$t->get_name()} <b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{foreach from=$t->get_exercices_ordered() item=e} {foreach from=$t->get_exercices_ordered() item=e}
<li><a href="/{$SALT_ADMIN}/{$t->get_id()}-{$t->get_name()}/{$e->get_id()}">{$e->get_name()}</a></li> <li><a href="/{$SALT_ADMIN}/ex/{$t->get_id()}-{$t->get_name()}/{$e->get_id()}">{$e->get_name()}</a></li>
{/foreach} {/foreach}
</ul> </ul>
</li> </li>