function modRepo(&$url) { checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; $lang =& DoceboLanguage::createInstance('light_repo'); $file_man = new LightRepoManager(getLogUserId(), $_SESSION['idCourse']); $id_repo = importVar('id_repo', true, 0); // recovering file repository information $repo = false; if ($id_repo != 0) { $repo = $file_man->getRepoDetails($id_repo); } if ($repo == false) { $repo[LR_TITLE] = ''; $repo[LR_DESCR] = ''; } cout(getTitleArea(array($url->getUrl() => $lang->def('_TITLE_LIGHT_REPO'), $id_repo == 0 ? $lang->def('_NEW_REPOSITORY') : $lang->def('_MOD') . ' ' . $repo[LR_TITLE]), 'light_repo') . '<div class="std_block">', 'content'); // save modification if needed if (isset($_POST['save'])) { $data[LR_IDCOURSE] = $_SESSION['idCourse']; $data[LR_TITLE] = importVar('repo_title', false, ''); $data[LR_DESCR] = importVar('repo_descr', false, ''); if (trim($data[LR_TITLE]) == '') { $data[LR_TITLE] = $lang->def('_NOTITLE'); } if (!$file_man->saveRepo($id_repo, $data)) { cout(Get::append_alert($lang->def('_ERR_MOD_REPO')), 'content'); } else { Util::jump_to($url->getUrl('result=ok_mod')); } } // form for input cout('' . Form::openForm('mod_repo_form', $url->getUrl('op=mod_repo')) . Form::openElementSpace() . Form::getHidden('id_repo', 'id_repo', $id_repo) . Form::getTextfield($lang->def('_TITLE'), 'repo_title', 'repo_title', 255, importVar('repo_title', false, $repo[LR_TITLE])) . Form::getTextarea($lang->def('_DESCRIPTION'), 'repo_descr', 'repo_descr', importVar('repo_descr', false, $repo[LR_DESCR])) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm(), 'content'); cout('</div>', 'content'); }