Adds administration page for names type.
authorStéphane Jacob <jacou@melix.net>
Mon, 19 Jan 2009 22:05:52 +0000 (23:05 +0100)
committerStéphane Jacob <jacou@melix.net>
Mon, 19 Jan 2009 22:05:52 +0000 (23:05 +0100)
modules/profile.php
templates/admin/index.tpl

index 51302ed..b6f5cfc 100644 (file)
@@ -72,6 +72,7 @@ class ProfileModule extends PLModule
             'admin/fonctions'            => $this->make_hook('admin_fonctions',            AUTH_MDP, 'admin'),
             'admin/corps_enum'           => $this->make_hook('admin_corps_enum',           AUTH_MDP, 'admin'),
             'admin/corps_rank'           => $this->make_hook('admin_corps_rank',           AUTH_MDP, 'admin'),
+            'admin/names'                => $this->make_hook('admin_names',                AUTH_MDP, 'admin'),
 
         );
     }
@@ -812,6 +813,17 @@ class ProfileModule extends PLModule
                 break;
         }
     }
+    function handler_admin_names(&$page, $action = 'list', $id = null) {
+        $page->setTitle('Administration - Types de noms');
+        $page->assign('title', 'Gestion des types de noms');
+        $table_editor = new PLTableEditor('admin/names', 'profile_name_enum', 'id', true);
+        $table_editor->describe('name', 'Nom', true);
+        $table_editor->describe('explanations', 'Explications', true);
+        $table_editor->describe('type', 'Type', true);
+        $table_editor->describe('flags', 'Flags', true);
+        $table_editor->describe('score', 'Score', true);
+        $table_editor->apply($page, $action, $id);
+    }
     function handler_admin_binets(&$page, $action = 'list', $id = null) {
         $page->setTitle('Administration - Binets');
         $page->assign('title', 'Gestion des binets');
index 312d36d..5edf85e 100644 (file)
       <a href="admin/medals">Décorations</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
       <a href="admin/sections">Sections</a>
+      &nbsp;&nbsp;|&nbsp;&nbsp;
+      <a href="admin/names">Noms</a>
     </td>
   </tr>
   <tr class="impair">