foreach ($languages as $language) { $question[$language] = $rquestion[$language]; $answer[$language] = $ranswer[$language]; } if ($continue) { if (!$faq_id) { $new_faq_id = time(); $faq['faq_id'] = $new_faq_id; $faq['evaluation'] = 0; $done = orsee_db_save_array($faq, "faqs", $faq['faq_id'], "faq_id"); $question['content_name'] = $new_faq_id; $question['content_type'] = "faq_question"; $done = lang__insert_to_lang($question); $answer['content_name'] = $new_faq_id; $answer['content_type'] = "faq_answer"; $done = lang__insert_to_lang($answer); log__admin("faq_create", "faq_id:" . $new_faq_id); } else { $done = orsee_db_save_array($question, "lang", $question['lang_id'], "lang_id"); $done = orsee_db_save_array($answer, "lang", $answer['lang_id'], "lang_id"); log__admin("faq_edit", "faq_id:" . $faq_id); } message(lang('changes_saved')); redirect('admin/faq_edit.php?faq_id=' . $question['content_name']); } } } if ($proceed) { show_message(); // form echo '<center>';
if ($continue) { $sitem = $_REQUEST; $sitem['content_type'] = $item; if (!$id) { $new = true; } else { $new = false; } if ($new && $new_id == "time") { $sitem['content_name'] = time(); } if ($new_id == "content_shortcut") { $sitem['content_name'] = trim($_REQUEST['content_shortcut']); } if ($new) { $id = lang__insert_to_lang($sitem); $done = true; } else { $done = orsee_db_save_array($sitem, "lang", $id, "lang_id"); } if (!$new && $new_id == "time") { $sitem['content_name'] = trim($_REQUEST['content_shortcut']); } if ($done) { log__admin($item . "_edit", "lang_id:" . $sitem['content_type'] . ',' . $sitem['content_name']); message(lang('changes_saved')); if ($new) { redirect('admin/lang_item_main.php?&item=' . $item); } else { redirect('admin/lang_item_edit.php?id=' . $id . '&item=' . $item); }
$sitem = $_REQUEST; $sitem['content_type'] = 'experiment_session_reminder_mail'; $sitem['content_name'] = $experiment_id; // prepare lang stuff foreach ($inv_langs as $inv_lang) { $sitem[$inv_lang] = $sitem[$inv_lang . '_subject'] . "\n" . $sitem[$inv_lang . '_body']; } // well: just to be sure: for all other languages, copy the public default lang foreach ($installed_langs as $inst_lang) { if (!in_array($inst_lang, $inv_langs)) { $sitem[$inst_lang] = $sitem[$settings['public_standard_language']]; } } // is unknown or known? if (!$id) { $done = lang__insert_to_lang($sitem); } else { $done = orsee_db_save_array($sitem, "lang", $id, "lang_id"); } if ($done) { message(lang('mail_text_saved')); } else { message(lang('database_error')); } log__admin("experiment_customize_session_reminder", "experiment:" . $experiment['experiment_name']); if ($save_preview) { redirect('admin/experiment_customize_reminder.php?experiment_id=' . $experiment_id . '&show_preview=true'); } else { redirect('admin/experiment_customize_reminder.php?experiment_id=' . $experiment_id); } }
$now = time(); $i = 0; while ($line = pdo_fetch_assoc($result)) { if ($line['upload_type']) { if (isset($filecat_map[$line['upload_type']])) { $line['upload_type'] = $filecat_map[$line['upload_type']]; } else { $id = $now + $i; $lline = array(); $lline['content_type'] = 'file_upload_category'; $lline['content_name'] = $id; foreach ($new_langs as $tl) { $lline[$tl] = $line['upload_type']; } if ($do_insert) { $done = lang__insert_to_lang($lline); } $i++; $line['upload_type'] = $id; } } else { $line['upload_type'] = 7; } $line = convert_array_to_UTF8($line); if ($do_insert) { $done = orsee_db_save_array($line, "uploads", $line['upload_id'], "upload_id"); } } $dquery = "DELETE FROM " . $new_db_name . "." . table('uploads_data') . ""; if ($do_delete) { $done = or_query($dquery);
$lsub['content_type'] = "subjectpool"; $lsub['content_name'] = $subpool_id; } else { $new = false; $pars = array(':subpool_id' => $subpool_id); $query = "SELECT * from " . table('lang') . " \n\t\t\t\t\t\tWHERE content_type='subjectpool' \n\t\t\t\t\t\tAND content_name= :subpool_id"; $lsub = orsee_query($query, $pars); } $subpool = $_REQUEST; $subpool['experiment_types'] = id_array_to_db_string($exptype_ids); foreach ($languages as $language) { $lsub[$language] = $selfdesc[$language]; } $done = orsee_db_save_array($subpool, "subpools", $subpool_id, "subpool_id"); if ($new) { $lsub['lang_id'] = lang__insert_to_lang($lsub); } else { $done = orsee_db_save_array($lsub, "lang", $lsub['lang_id'], "lang_id"); } message(lang('changes_saved')); log__admin("subjectpool_edit", "subjectpool:" . $subpool['subpool_name'] . "\nsubpool_id:" . $subpool['subpool_id']); redirect("admin/subpool_edit.php?subpool_id=" . $subpool_id); } else { $subpool = $_REQUEST; $subpool['exptypes'] = array(); foreach ($exptype_ids as $exptype_id) { $subpool['exptypes'][$exptype_id] = $exptype_id; } } } }
} if ($lang_id) { $allow = check_allow('lang_symbol_edit', 'lang_main.php'); } else { $allow = check_allow('lang_symbol_add', 'lang_main.php'); } } if ($proceed) { $languages = get_languages(); if (isset($_REQUEST['save']) && $_REQUEST['save']) { $continue = true; $_REQUEST['content_type'] = "lang"; if ($lang_id) { $done = orsee_db_save_array($_REQUEST, "lang", $lang_id, "lang_id"); } else { $lang_id = lang__insert_to_lang($_REQUEST); } message(lang('changes_saved')); log__admin("language_symbol_edit", "lang_id:lang," . $_REQUEST['content_name']); redirect("admin/lang_symbol_edit.php?lang_id=" . $lang_id); } } if ($proceed) { // if lang id given, load data if ($lang_id) { $content = orsee_db_load_array("lang", $lang_id, "lang_id"); } else { $content = array('content_name' => ''); } if ($lang_id && !isset($content['lang_id'])) { redirect("admin/lang_main.php");
$exptype_id = $line['new_sub']; $lsub['content_type'] = "experiment_type"; $lsub['content_name'] = $exptype_id; } else { $new_entry = false; $query = "SELECT * from " . table('lang') . "\n WHERE content_type='experiment_type'\n AND content_name='" . $exptype_id . "'"; $lsub = orsee_query($query); } $exptype = $_REQUEST; $exptype['exptype_mapping'] = implode(",", $map); foreach ($languages as $language) { $lsub[$language] = $selfdesc[$language]; } $done = orsee_db_save_array($exptype, "experiment_types", $exptype_id, "exptype_id"); if ($new_entry) { $done = lang__insert_to_lang($lsub); } else { $done = orsee_db_save_array($lsub, "lang", $lsub['lang_id'], "lang_id"); } log__admin("experimenttype_edit", $exptype['exptype_name']); message(lang('changes_saved')); redirect("admin/experiment_type_edit.php?exptype_id=" . $exptype_id); } else { $exptype = $_REQUEST; } } } if ($proceed) { // form echo ' <CENTER>'; show_message();
$query = "SELECT * from " . table('lang') . " WHERE content_type='participant_status_name' AND content_name= :status_id"; $status_name_lang = orsee_query($query, $pars); if ($not_unconfirmed) { $query = "SELECT * from " . table('lang') . " WHERE content_type='participant_status_error' AND content_name= :status_id"; $status_error_lang = orsee_query($query, $pars); } } foreach ($languages as $language) { $status_name_lang[$language] = $status_name[$language]; if ($not_unconfirmed) { $status_error_lang[$language] = $status_error[$language]; } } if ($new) { $status_name['lang_id'] = lang__insert_to_lang($status_name_lang); $status_error['lang_id'] = lang__insert_to_lang($status_error_lang); } else { $done = orsee_db_save_array($status_name_lang, "lang", $status_name_lang['lang_id'], "lang_id"); if ($not_unconfirmed) { $done = orsee_db_save_array($status_error_lang, "lang", $status_error_lang['lang_id'], "lang_id"); } } if ($not_unconfirmed) { $status = $_REQUEST; $status['status_id'] = $status_id; $pars = array(':status_id' => $status_id); if ($status['is_default_active'] == "y") { $query = "UPDATE " . table('participant_statuses') . "\n\t\t\t\t\t\t\tSET is_default_active='n'\n\t\t\t\t\t\t\tWHERE status_id!= :status_id"; $done = or_query($query, $pars); } if ($status['is_default_inactive'] == "y") {
$pstatus_display_name_lang['content_name'] = $pstatus_id; } else { $new = false; $pars = array(':pstatus_id' => $pstatus_id); $query = "SELECT * from " . table('lang') . "\n WHERE content_type='participation_status_internal_name'\n AND content_name= :pstatus_id"; $pstatus_internal_name_lang = orsee_query($query, $pars); $query = "SELECT * from " . table('lang') . "\n WHERE content_type='participation_status_display_name'\n AND content_name= :pstatus_id"; $pstatus_display_name_lang = orsee_query($query, $pars); } foreach ($languages as $language) { $pstatus_internal_name_lang[$language] = $pstatus_internal_name[$language]; $pstatus_display_name_lang[$language] = $pstatus_display_name[$language]; } if ($new) { $pstatus_internal_name['lang_id'] = lang__insert_to_lang($pstatus_internal_name_lang); $pstatus_display_name['lang_id'] = lang__insert_to_lang($pstatus_display_name_lang); } else { $done = orsee_db_save_array($pstatus_internal_name_lang, "lang", $pstatus_internal_name_lang['lang_id'], "lang_id"); $done = orsee_db_save_array($pstatus_display_name_lang, "lang", $pstatus_display_name_lang['lang_id'], "lang_id"); } if ($not_assigned) { $pstatus = $_REQUEST; $pstatus['pstatus_id'] = $pstatus_id; $done = orsee_db_save_array($pstatus, "participation_statuses", $pstatus_id, "pstatus_id"); } message(lang('changes_saved')); log__admin("participation_status_edit", "pstatus_id:" . $pstatus['pstatus_id']); redirect("admin/participation_status_edit.php?pstatus_id=" . $pstatus_id); } else { $pstatus = $_REQUEST; }