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,54 +41,57 @@ if ($n && $p[0] == SALT_ADMIN)
else
$cmpstr = $p[1];
switch($cmpstr)
{
case "certificate":
case "certificate/":
case "certificate/newca":
case "certificate/newca/":
case "certificate/deleteca":
case "certificate/deleteca/":
$page = require("admin/certificate.php");
break;
if (strpos($cmpstr, 'ex/') === 0)
$page = require("admin/exercice.php");
else
switch($cmpstr)
{
case "certificate":
case "certificate/":
case "certificate/newca":
case "certificate/newca/":
case "certificate/deleteca":
case "certificate/deleteca/":
$page = require("admin/certificate.php");
break;
case "exercices/import":
case "exercices/import/":
$page = require("admin/import_exercices.php");
break;
case "exercices/import":
case "exercices/import/":
$page = require("admin/import_exercices.php");
break;
// Theme
case "themes":
case "themes/":
$page = require("admin/list_themes.php");
break;
// Theme
case "themes":
case "themes/":
$page = require("admin/list_themes.php");
break;
case "themes/import":
case "themes/import/":
$page = require("admin/import_themes.php");
break;
case "themes/import":
case "themes/import/":
$page = require("admin/import_themes.php");
break;
case "themes/export":
case "themes/export/":
$page = require("admin/export_theme.php");
break;
case "themes/export":
case "themes/export/":
$page = require("admin/export_theme.php");
break;
// Users
case "teams":
case "teams/":
$page = require("admin/list_users.php");
break;
// Users
case "teams":
case "teams/":
$page = require("admin/list_users.php");
break;
case "teams/import":
case "teams/import/":
$page = require("admin/import_users.php");
break;
case "teams/import":
case "teams/import/":
$page = require("admin/import_users.php");
break;
case "teams/export":
case "teams/export/":
$page = require("admin/export_users.php");
break;
}
case "teams/export":
case "teams/export/":
$page = require("admin/export_users.php");
break;
}
}
}

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>
{foreach from=$themes item=t}
<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">
{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}
</ul>
</li>