function handler_forums_bans($page, $action = 'list', $id = null) { $page->setTitle('Administration - Bannissements des forums'); $page->assign('title', 'Gestion des mises au ban'); $table_editor = new PLTableEditor('admin/forums', 'forum_innd', 'id_innd'); $table_editor->add_sort_field('priority', true, true); $table_editor->describe('read_perm', 'lecture', true); $table_editor->describe('write_perm', 'écriture', true); $table_editor->describe('priority', 'priorité', true); $table_editor->describe('comment', 'commentaire', true); $table_editor->apply($page, $action, $id); $page->changeTpl('forums/admin.tpl'); }
function handler_admin_nl_cat($page, $action = 'list', $id = null) { $nl = $this->getNl(); if (!$nl) { return PL_NOT_FOUND; } if (!$nl->mayEdit()) { return PL_FORBIDDEN; } $page->setTitle('Administration - Newsletter : Catégories'); $page->assign('title', 'Gestion des catégories de la newsletter'); $table_editor = new PLTableEditor($nl->adminPrefix() . '/categories', 'newsletter_cat', 'cid'); $table_editor->describe('title', 'intitulé', true); $table_editor->describe('pos', 'position', true); if ($nl->group == Newsletter::GROUP_XORG) { $table_editor->add_option_table('newsletters', 'newsletters.id = t.nlid'); $table_editor->add_option_field('newsletters.name', 'newsletter_name', 'Newsletter', null, 'nlid'); $table_editor->describe('nlid', 'ID NL', true); } else { $table_editor->force_field_value('nlid', $nl->id); $table_editor->describe('nlid', 'nlid', false, false); } // Prevent deletion. $table_editor->on_delete(null, null); $table_editor->apply($page, $action, $id); }
function handler_admin_trusted($page, $action = 'list', $id = null) { $page->setTitle('Sites tiers de confiance'); $page->assign('title', 'Sites tiers de confiance globaux pour OpenId'); $table_editor = new PLTableEditor('admin/openid/trusted', 'account_auth_openid', 'id'); $table_editor->set_where_clause('uid IS NULL'); $table_editor->vars['uid']['display_list'] = false; $table_editor->vars['uid']['display_item'] = false; $table_editor->describe('url', 'site tiers', true); $page->assign('readonly', true); $table_editor->apply($page, $action, $id); }
function handler_account_types($page, $action = 'list', $id = null) { $page->setTitle('Administration - Types de comptes'); $page->assign('title', 'Gestion des types de comptes'); $table_editor = new PLTableEditor('admin/account/types', 'account_types', 'type', true); $table_editor->describe('type', 'Catégorie', true); $table_editor->describe('perms', 'Permissions associées', true); $table_editor->apply($page, $action, $id); $page->trigWarning('Le niveau de visibilité "ax", utilisé par la permission "directory_ax", ' . 'correspond à la visibilité dans l\'annuaire papier.'); }
function handler_admin_tips($page, $action = 'list', $id = null) { $page->setTitle('Administration - Astuces'); $page->assign('title', 'Gestion des Astuces'); $table_editor = new PLTableEditor('admin/tips', 'reminder_tips', 'id'); $table_editor->describe('expiration', 'date de péremption', true); $table_editor->describe('promo_min', 'promo. min (0 aucune)', false, true); $table_editor->describe('promo_max', 'promo. max (0 aucune)', false, true); $table_editor->describe('title', 'titre', true); $table_editor->describe('state', 'actif', true); $table_editor->describe('text', 'texte (html) de l\'astuce', false, true); $table_editor->describe('priority', '0<=priorité<=255', true); $table_editor->list_on_edit(false); $table_editor->apply($page, $action, $id); if ($action == 'edit' && !is_null($id) || $action == 'update') { $page->changeTpl('events/admin_tips.tpl'); } }
function handler_adm_methods($page, $action = "list", $id = null) { // show and edit payment methods $page->setTitle('Administration - Paiements - Méthodes'); $page->assign('title', 'Méthodes de paiement'); $table_editor = new PLTableEditor('admin/payments/methods', 'payment_methods', 'id'); $table_editor->apply($page, $action, $id); }
function handler_admin_medals($page, $action = 'list', $id = null) { $page->setTitle('Administration - Distinctions'); $page->assign('title', 'Gestion des Distinctions'); $table_editor = new PLTableEditor('admin/medals', 'profile_medal_enum', 'id'); $table_editor->describe('text', 'intitulé', true); $table_editor->describe('img', 'nom de l\'image', false, true); $table_editor->describe('flags', 'valider', true); $table_editor->apply($page, $action, $id); if ($id && $action == 'edit') { $page->changeTpl('profile/admin_decos.tpl'); $mid = $id; if (Post::v('act') == 'del') { XDB::execute('DELETE FROM profile_medal_grade_enum WHERE mid={?} AND gid={?}', $mid, Post::i('gid')); } else { foreach (Post::v('grades', array()) as $gid => $text) { if ($gid === 0) { if (!empty($text)) { $res = XDB::query('SELECT MAX(gid) FROM profile_medal_grade_enum WHERE mid = {?}', $mid); $gid = $res->fetchOneCell() + 1; XDB::execute('INSERT INTO profile_medal_grade_enum (mid, gid, text, pos) VALUES ({?}, {?}, {?}, {?})', $mid, $gid, $text, $_POST['pos']['0']); } } else { XDB::execute('UPDATE profile_medal_grade_enum SET pos={?}, text={?} WHERE gid={?} AND mid={?}', $_POST['pos'][$gid], $text, $gid, $mid); } } } $res = XDB::iterator('SELECT gid, text, pos FROM profile_medal_grade_enum WHERE mid={?} ORDER BY pos', $mid); $page->assign('grades', $res); } }