function show_action_list() { $out = avTable::show_action_list(); if (is_permission('avnews_auth')) { $out .= '<input type="radio" name="action" value="mail"> siøsti þmogënams paðtu<br>'; $out .= '<input type="radio" name="action" value="change_visible"> ' . $GLOBALS['g_lang']['action_make_selected_records'] . ' <select name="visibility"><option value="1" selected>patvirtintus</option><option value="0">nepatvirtintus</option></select><br>'; } return $out; }
} $g_tpl->set_var('module', $module); $g_tpl->set_var('offset', $offset); $g_tpl->set_var('table', $table); $g_tpl->set_var('order', $order); $g_tpl->set_var('search', $search); $g_tpl->set_var('pid', $pid); $g_tpl->set_var('new', $new); $g_tpl->set_var('header', $handler->description); switch ($page) { case 'edit': check_permission($table . '_list'); if (isset($submit)) { // for new record check 'table_new' permission first, if thre is no such, then 'table_edit' if ('0' == $_f_id) { if (!is_permission($table . '_new')) { check_permission($table . '_edit'); } } else { check_permission($table . '_edit'); } $handler->pickup_submit(); if ($handler->validate()) { $handler->change(); redirect($_SERVER['PHP_SELF'] . "?module={$module}&table={$table}&offset={$offset}&order={$order}&search={$search}&pid={$pid}&page=list"); } } else { if (isset($id)) { if (!$handler->load($id)) { // we have got erroneous id }
function check_permission($pm_name) { global $g_theme_dir, $RELPATH; if (!is_permission($pm_name)) { redirect($RELPATH . 'control/tpl/' . $g_theme_dir . 'error.html'); } return true; }