// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+
if (!defined("PHPWG_ROOT_PATH")) {
    die("Hacking attempt!");
}
include_once PHPWG_ROOT_PATH . 'admin/include/languages.class.php';
$template->set_filenames(array('languages' => 'languages_installed.tpl'));
$base_url = get_root_url() . 'admin.php?page=' . $page['page'];
$languages = new languages();
$languages->get_db_languages();
//--------------------------------------------------perform requested actions
if (isset($_GET['action']) and isset($_GET['language'])) {
    $page['errors'] = $languages->perform_action($_GET['action'], $_GET['language']);
    if (empty($page['errors'])) {
        redirect($base_url);
    }
}
// +-----------------------------------------------------------------------+
// |                     start template output                             |
// +-----------------------------------------------------------------------+
$default_language = get_default_language();
$tpl_languages = array();
foreach ($languages->fs_languages as $language_id => $language) {
    $language['u_action'] = add_url_params($base_url, array('language' => $language_id));
    if (in_array($language_id, array_keys($languages->db_languages))) {