function awcs_forum_admin_tplt($action) { global $wgRequest, $action_url; $tplt_cls = new awc_admin_tplt_cls(); $tplt_cls->tplt_id = 1; $tplt_cls->thm_id = 0; $spl = explode("/", $action); $todo = $spl[2]; $tplt_cls->id = $spl[3]; if ($tplt_cls->id == '' || !is_numeric($tplt_cls->id)) { $tplt_cls->id = $wgRequest->getVal('id'); } $tplt_cls->tplt_what = $wgRequest->getVal('what'); $tplt_cls->todo2 = $wgRequest->getVal('todo2'); if ($tplt_cls->todo2 == null) { $tplt_cls->todo2 = $spl[3]; } if ($todo != 'display') { Set_AWC_Forum_BreadCrumbs('<a href="' . awc_url . 'admin/tplt/display">' . get_awcsforum_word('admin_edittplt') . '</a>'); } else { Set_AWC_Forum_BreadCrumbs(get_awcsforum_word('admin_edittplt')); } switch ($todo) { case 'save_func': $tplt_cls->save_func(); break; case 'show_func': $tplt_cls->show_func(); break; case 'show_section': $tplt_cls->section = $wgRequest->getVal('tplt_section'); $tplt_cls->show_section(); break; case 'export_xml': $tplt_cls->export_xml(); break; case 'import_xml': $tplt_cls->import_xml(); break; case 'update_tplt': $tplt_cls->update_tplt(); break; case 'search': $tplt_cls->search(); break; case 'find_and_replace': $tplt_cls->find_and_replace(); break; case 'search_version': $tplt_cls->search_version(); break; case 'tplt_delete': $tplt_cls->delete_all_tplt(); break; case 'set_default': $tplt_cls->set_default(); break; default: $tplt_cls->show_sections_list(); break; } }