Example #1
0
function edithtml()
{
    checkPerm('mod');
    require_once _base_ . '/lib/lib.form.php';
    $query = "\r\n\tSELECT textof\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_htmlfront \r\n\tWHERE id_course = '" . $_SESSION['idCourse'] . "'";
    $re_htmlfront = sql_query($query);
    $error = false;
    if (isset($_POST['save'])) {
        if (mysql_num_rows($re_htmlfront) > 0) {
            $upd_query = "\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_htmlfront \r\n\t\t\tSET textof = '" . $_POST['description'] . "'\r\n\t\t\tWHERE id_course = '" . $_SESSION['idCourse'] . "'";
            $re = sql_query($upd_query);
        } else {
            $ins_query = "\r\n\t\t\tINSERT INTO " . $GLOBALS['prefix_lms'] . "_htmlfront \r\n\t\t\t( id_course, textof) VALUES \r\n\t\t\t( \t'" . $_SESSION['idCourse'] . "',\r\n\t\t\t\t'" . $_POST['description'] . "' )";
            $re = sql_query($ins_query);
        }
        if ($re) {
            Util::jump_to('index.php?modname=htmlfront&op=showhtml&saveok=1');
        } else {
            $error = true;
        }
    }
    $lang =& DoceboLanguage::createInstance('htmlfront', 'lms');
    list($textof) = sql_fetch_row($re_htmlfront);
    $title_page = array('index.php?modname=htmlfront&op=showhtml' => $lang->def('_HTMLFRONT'), $lang->def('_MOD'));
    $GLOBALS['page']->add(getTitleArea($title_page, 'htmlfront') . '<div class="std_block">' . getBackUi('index.php?modname=htmlfront&amp;op=showhtml', $lang->def('_BACK')) . ($error ? getErrorUi($lang->def('_ERROR_IN_SAVE')) : '') . Form::openForm('formnotes', 'index.php?modname=htmlfront&amp;op=edithtml') . Form::openElementSpace() . Form::getTextarea($lang->def('_TEXTOF'), 'description', 'description', importVar('description', false, $textof)) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
}
    public function getAddEditForm($form_url, $data)
    {
        $this->loadJs();
        $res = '';
        $e = false;
        if ($data['rule_id'] > 0) {
            $e = true;
        }
        $res .= Form::openForm('main_form', $form_url);
        $res .= Form::openElementSpace() . Form::getTextfield(Lang::t('_FROM', 'test'), 'from_score', 'from_score', 11, $e ? $data['from_score'] : '') . Form::getTextfield(Lang::t('_TO', 'test'), 'to_score', 'to_score', 11, $e ? $data['to_score'] : '') . '<br />' . '<p class="section_title">' . Lang::t('_COMPETENCES', 'test') . '</p>' . '<div id="competence_box"></div>' . '<div class="form_line_l">
					<p><label for="input_add_competence" class="floating">' . Lang::t('_NAME', 'test') . '</label></p>
					<div class="form_autocomplete_container">
					<input type="text" maxlength="255" value="" name="input_add_competence" id="input_add_competence" class="textfield">
					<a href="" id="link_add_competence"><img alt="' . Lang::t('_ADD', 'test') . '" src="' . getPathImage() . 'standard/add.png" class="valing-middle"></a>
					<div id="box_autocomplete_competence"></div>
					</div>
				</div>' . '<br />' . '<p class="section_title">' . Lang::t('_COURSES', 'test') . '</p>' . '<div id="course_box"></div>' . '<div class="form_line_l">
					<p><label for="input_add_course" class="floating">' . Lang::t('_NEW_COURSE', 'test') . '</label></p>
					<div class="form_autocomplete_container">
					<input type="text" maxlength="255" value="" name="input_add_course" id="input_add_course" class="textfield">
					<a href="" id="link_add_course"><img alt="' . Lang::t('_ADD', 'test') . '" src="' . getPathImage() . 'standard/add.png" class="valing-middle"></a>
					<div id="box_autocomplete_course"></div>
					</div>
				</div>' . '<br /><br />' . Form::getTextarea(Lang::t('_FEEDBACK_TEXT', 'test'), 'feedback_txt', 'feedback_txt', $e ? $data['feedback_txt'] : '') . Form::getHidden('rule_id', 'rule_id', (int) $data['rule_id']) . Form::getHidden('competences_list', 'competences_list', '') . Form::getHidden('courses_list', 'courses_list', '') . Form::getHidden('test_id', 'test_id', (int) $data['test_id']) . Form::getHidden('category_id', 'category_id', (int) $data['category_id']) . Form::getHidden('save', 'save', '1') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('btn_save', 'btn_save', Lang::t('_SAVE', 'test')) . Form::getButton('btn_cancel', 'btn_cancel', Lang::t('_UNDO', 'test')) . Form::closeButtonSpace();
        $res .= Form::closeForm();
        $res .= '<script type="text/javascript">
			var course_ac_url="' . Get::rel_path('adm') . '/ajax.adm_server.php?mn=course&plf=lms&op=course_autocomplete&results=20' . '";
			var competence_ac_url="' . Get::rel_path('adm') . '/ajax.adm_server.php?r=adm/competences/competences_autocomplete' . '";
			var lang={"remove_item": "' . Lang::t('_DEL', 'test') . '"};
			var course_arr=' . ($e && !empty($data['courses_list']) ? $data['courses_list'] : '{}') . ';
			var competence_arr=' . ($e && !empty($data['competences_list']) ? $data['competences_list'] : '{}') . ';
			</script>';
        return $res;
    }
Example #3
0
 function moditem($object_item)
 {
     //checkPerm('view', false, 'storage');
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('item');
     $back_coded = htmlentities(urlencode($object_item->back_url));
     list($title, $description) = sql_fetch_row(sql_query("\r\n\tSELECT title, description \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_materials_lesson \r\n\tWHERE author = " . getLogUserId() . " AND idLesson = '" . $object_item->getId() . "'"));
     $GLOBALS['page']->add(getTitleArea($lang->def('_SECTIONNAME_ITEM'), 'item') . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&amp;', $object_item->back_url) . '&amp;mod_result=0', $lang->def('_BACK')) . Form::openForm('itemform', 'index.php?modname=item&amp;op=upitem', 'std_form', 'post', 'multipart/form-data') . Form::openElementSpace() . Form::getHidden('idItem', 'idItem', $object_item->getId()) . Form::getHidden('back_url', 'back_url', htmlentities(urlencode($object_item->back_url))) . Form::getTextfield($lang->def('_TITLE'), 'title', 'title', 100, $title) . Form::getFilefield($lang->def('_FILE_MOD'), 'file', 'attach') . Form::getTextarea($lang->def('_DESCRIPTION'), 'description', 'description', $description) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('additem', 'additem', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
 }
Example #4
0
function modtest()
{
    checkPerm('view', false, 'storage');
    $lang =& DoceboLanguage::createInstance('test');
    require_once _base_ . '/lib/lib.form.php';
    $id_test = importVar('idTest', true, 0);
    $back_url = urldecode(importVar('back_url'));
    $url_encode = htmlentities(urlencode($back_url));
    list($test_title, $textof) = sql_fetch_row(sql_query("\r\n\tSELECT title, description\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_test\r\n\tWHERE idTest = '" . $id_test . "'"));
    $GLOBALS['page']->add(getTitleArea($lang->def('_TEST_SECTION'), 'test') . '<div class="std_block">' . getBackUi('index.php?modname=test&amp;op=modtestgui&amp;idTest=' . $id_test . '&amp;back_url=' . $url_encode, $lang->def('_BACK')) . Form::OpenForm('addtest_form', 'index.php?modname=test&amp;op=uptest') . Form::openElementSpace() . Form::getHidden('idTest', 'idTest', $id_test) . Form::getHidden('back_url', 'back_url', $url_encode) . Form::getTextfield($lang->def('_TITLE'), 'title', 'title', '255', $test_title) . Form::getTextarea($lang->def('_DESCRIPTION'), 'textof', 'textof', $textof) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('button_ins', 'button_ins', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
}
Example #5
0
function list_element_certificate()
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.form.php';
    require_once _base_ . '/lib/lib.table.php';
    $mod_perm = checkPerm('mod', true);
    $id_certificate = importVar('id_certificate', true);
    // create a language istance for module admin_certificate
    $lang =& DoceboLanguage::createInstance('certificate', 'lms');
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    $form = new Form();
    $page_title = array('index.php?modname=pcertificate&amp;op=certificate' => $lang->def('_TITLE_CERTIFICATE'), $lang->def('_STRUCTURE_CERTIFICATE'));
    $out->add(getTitleArea($page_title, 'certificate') . '<div class="std_block">' . getBackUi('index.php?modname=pcertificate&amp;op=certificate', $lang->def('_BACK')));
    if (isset($_GET['result'])) {
        switch ($_GET['result']) {
            case "ok":
                $out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')));
                break;
            case "err":
                $out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
                break;
            case "err_del":
                $out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
                break;
        }
    }
    $query_structure = "\r\n\tSELECT cert_structure, orientation, bgimage\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_certificate \r\n\tWHERE id_certificate = '" . (int) $id_certificate . "'";
    list($structure, $orientation, $bgimage) = sql_fetch_row(sql_query($query_structure));
    $out->add('<div class="std_block">');
    $out->add(getInfoUi($lang->def('_CERTIFICATE_WARNING')));
    $out->add($form->openForm('structure_certificate', 'index.php?modname=pcertificate&amp;op=savecertificate', false, false, 'multipart/form-data'));
    $out->add($form->openElementSpace() . $form->getTextarea($lang->def('_STRUCTURE_CERTIFICATE'), 'structure', 'structure', $structure) . '<p><b>' . $lang->def('_ORIENTATION') . '</b></p>' . $form->getRadio($lang->def('_PORTRAIT'), 'portrait', 'orientation', 'P', $orientation == 'P') . $form->getRadio($lang->def('_LANDSCAPE'), 'landscape', 'orientation', 'L', $orientation == 'L') . $form->getExtendedFilefield($lang->def('_BACK_IMAGE'), 'bgimage', 'bgimage', $bgimage) . $form->closeElementSpace() . $form->openButtonSpace() . $form->getHidden('id_certificate', 'id_certificate', $id_certificate) . $form->getButton('save_structure', 'save_structure', $lang->def('_SAVE')) . $form->getButton('undo', 'undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm());
    $tb = new Table(0, $lang->def('_TAG_LIST_CAPTION'), $lang->def('_TAG_LIST_SUMMARY'));
    $tb->setColsStyle(array('', ''));
    $tb->addHead(array($lang->def('_TAG_CODE'), $lang->def('_TAG_DESCRIPTION')));
    //search query of certificates tag
    $query_format_tag = "\r\n\tSELECT file_name, class_name \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_certificate_tags ";
    $re_certificate_tags = sql_query($query_format_tag);
    while (list($file_name, $class_name) = sql_fetch_row($re_certificate_tags)) {
        if (file_exists($GLOBALS['where_lms'] . '/lib/certificate/' . $file_name)) {
            require_once $GLOBALS['where_lms'] . '/lib/certificate/' . $file_name;
            $instance = new $class_name(0, 0);
            $this_subs = $instance->getSubstitutionTags();
            foreach ($this_subs as $tag => $description) {
                $tb->addBody(array($tag, $description));
            }
            // end foreach
        }
        // end if
    }
    $out->add($tb->getTable());
    $out->add('</div>');
}
Example #6
0
 function edit($back_poll)
 {
     $lang =& DoceboLanguage::createInstance('poll');
     require_once _base_ . '/lib/lib.form.php';
     $url_encode = htmlentities(urlencode($back_poll));
     if (isset($_POST['add_question'])) {
         if (!sql_query("\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_pollquest \r\n\t\t\tSET title_quest = '" . $_POST['title_quest'] . "' \r\n\t\t\tWHERE id_quest = '" . $this->id . "'")) {
             errorCommunication($lang->def('_ERR_INS_QUEST') . getBackUi('index.php?modname=question_poll&amp;op=edit&amp;type_quest=' . $this->getQuestionType() . '&amp;id_quest=' . $this->id . '&amp;back_poll=' . $url_encode, $lang->def('_BACK')));
         }
         Util::jump_to('' . $back_poll);
     }
     list($title_quest) = sql_fetch_row(sql_query("\r\n\t\tSELECT title_quest \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_pollquest \r\n\t\tWHERE id_quest = '" . $this->id . "'"));
     $GLOBALS['page']->add(getTitleArea($lang->def('_POLL_SECTION'), 'poll') . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&amp;', $back_poll), $lang->def('_BACK')) . '<div class="title_big">' . $lang->def('_QUEST_ACRN_' . strtoupper($this->getQuestionType())) . ' - ' . $lang->def('_QUEST_' . strtoupper($this->getQuestionType())) . '</div><br />' . Form::openForm('form_mod_quest', 'index.php?modname=question_poll&amp;op=edit') . Form::openElementSpace() . Form::getHidden('type_quest', 'type_quest', $this->getQuestionType()) . Form::getHidden('id_quest', 'id_quest', $this->id) . Form::getHidden('back_poll', 'back_poll', $url_encode) . Form::getTextarea($lang->def('_POLL_QUEST_TITLE'), 'title_quest', 'title_quest', $title_quest) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('add_question', 'add_question', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
 }
function newsletter()
{
    //access control
    //-TP// funAdminAccess('OP');
    checkPerm('view');
    require_once _base_ . '/lib/lib.form.php';
    $out =& $GLOBALS['page'];
    $out->setWorkingZone("content");
    $lang =& DoceboLanguage::createInstance('admin_newsletter', 'framework');
    YuiLib::load();
    addJs($GLOBALS['where_framework_relative'] . '/modules/newsletter/', 'newsletter.js');
    $form = new Form();
    $out->add(getTitleArea($lang->def("_NEWSLETTER"), "newsletter"));
    $p_size = intval(ini_get('post_max_size'));
    $u_size = intval(ini_get('upload_max_filesize'));
    $max_kb = $p_size < $u_size ? $p_size : $u_size;
    $max = ' (Max. ' . $max_kb . ' Mb) ';
    $out->add('<script>' . 'var _DEL=\'' . $lang->def('_DEL') . '\';' . 'var _ATTACHMENT=\'' . $lang->def('_ATTACHMENT') . '\';' . 'var _MAX=\'' . $max . '\';' . '</script>');
    $out->add("<div class=\"std_block\">\n");
    $acl_manager = Docebo::user()->getAclManager();
    $user_info = $acl_manager->getUser(Docebo::user()->getIdSt(), false);
    $myemail = $user_info[ACL_INFO_EMAIL];
    if (isset($err) && $err != "") {
        $out->add("<b><span class=\"fontRed\">{$err}</span><br />\n");
    }
    $out->add($form->openForm("newsletter_form", "index.php?modname=public_newsletter_admin&amp;op=initsend"));
    $out->add($form->openElementSpace());
    $out->add($form->getTextfield($lang->def("_SENDER"), "fromemail", "fromemail", 255, $myemail));
    $out->add($form->getTextfield($lang->def("_SUBJECT"), "sub", "sub", 255, ""));
    $out->add($form->getTextarea($lang->def("_DESCRIPTION"), "msg", "msg", ""));
    $lang_list = Docebo::langManager()->getAllLangCode();
    //array_unshift($lang_list, $lang->def("_DEFAULT"), $lang->def("_ALL"));
    $lang_list = array(_ANY_LANG_CODE => $lang->def("_ALL")) + $lang_list;
    $out->add('<div id="file">' . $form->getHidden('file_number', 'file_number', '1') . '<div id="div_file_1">' . $form->getFilefield($lang->def('_ATTACHMENT'), 'file_1', 'file_1', '', '', '<a href="#" onclick="delFile(\'1\'); return false;"><span id="rem_span">' . $lang->def('_DEL') . '</span><a>') . '</div>' . '</div>' . '<br/><a href="#" onclick="addFile(); return false;"><span id="add_span">' . $lang->def('_ADD') . '</span></a>');
    $out->add($form->getDropdown($lang->def("_LANGUAGE"), "sel_lang", "sel_lang", $lang_list));
    $out->add($form->getRadio($lang->def("_EMAIL"), "send_type_email", "send_type", "email", true));
    $out->add($form->getRadio($lang->def("_SEND_SMS"), "send_type_sms", "send_type", "sms", false));
    $out->add($form->closeElementSpace());
    $out->add($form->openButtonSpace());
    $out->add($form->getButton('send', 'send', $lang->def('_SEND')));
    $out->add($form->closeButtonSpace());
    $out->add($form->closeForm());
    $out->add("</div>\n");
}
Example #8
0
 function modpage($object_page)
 {
     checkPerm('view', false, 'storage');
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('htmlpage');
     //retriving info
     list($title, $textof) = sql_fetch_row(sql_query("\r\n\tSELECT title, textof \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_htmlpage \r\n\tWHERE idPage = '" . $object_page->getId() . "'"));
     // recuper gli allegati
     $path = '/appLms/htmlpages/';
     $query = "SELECT * FROM " . $GLOBALS['prefix_lms'] . "_htmlpage_attachment WHERE idpage = " . $object_page->getId();
     $res = mysql_query($query);
     $attachments = array();
     if ($res) {
         while ($row = mysql_fetch_assoc($res)) {
             $attachments[] = array('id' => $row['id'], 'title' => $row['title'], 'file' => $GLOBALS['where_files_relative'] . $path . $row['file']);
         }
     }
     $GLOBALS['page']->add(getTitleArea($lang->def('_SECT_PAGE'), 'htmlpage') . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&amp;', $object_page->back_url) . '&amp;mod_result=0', $lang->def('_BACK')) . Form::openForm('pageform', 'index.php?modname=htmlpage&amp;op=uppage', false, false, 'multipart/form-data') . Form::openElementSpace() . Form::getHidden('idPage', 'idPage', $object_page->getId()) . Form::getHidden('back_url', 'back_url', htmlentities(urlencode($object_page->back_url))) . '<script>' . "\n" . 'my_n=1;' . "\n" . 'function delAttachment(id) {' . "\n" . '	document.getElementById(id).style.textDecoration="line-through";' . "\n" . '	document.getElementById(\'iddelattachment\').value = document.getElementById(\'iddelattachment\').value+\';\'+id' . "\n" . '}' . "\n" . 'function addAttachment() {' . "\n" . '	my_file = "attach"+my_n;' . "\n" . '	my_filevalue = \'\';' . "\n" . '	if (document.getElementById(my_file))' . "\n" . '		my_filevalue = document.getElementById(my_file).value;' . "\n" . '	my_html = "' . str_replace(array("\r", "\r\n", "\n"), '', addslashes(Form::getFilefield($lang->def('_UPLOAD'), 'attach%%', 'attach%%'))) . '";' . "\n" . '	if (my_filevalue != \'\') {' . "\n" . '		my_n=my_n+1;' . "\n" . '		my_html = my_html.replace(/%%/gi,my_n);' . "\n" . '		newdiv = document.createElement("div");' . "\n" . '		newdiv.innerHTML = my_html;' . "\n" . '		my_divhtml = document.getElementById(\'attachment_area\');' . "\n" . '		my_divhtml.appendChild(newdiv);' . "\n" . '	}' . "\n" . '}' . "\n" . '</script>' . "\n" . '<div class="std_block">' . Form::getTextfield($lang->def('_TITLE'), 'title', 'title', 150, $title) . Form::getTextarea($lang->def('_TEXTOF'), 'textof', 'textof', $textof), 'content');
     foreach ($attachments as $attachment) {
         $GLOBALS['page']->add("<a id=\"" . $attachment['id'] . "\" href=\"" . $attachment['file'] . "\" target=\"_blank\">" . $attachment['title'] . "</a> (<a href=\"javascript:delAttachment(" . $attachment['id'] . ");\">x</a>)<br/>", 'content');
     }
     $GLOBALS['page']->add('<div id="attachment_area">' . Form::getHidden('iddelattachment', 'iddelattachment', '') . Form::getFilefield($lang->def('_UPLOAD'), 'attach1', 'attach1') . '</div>' . '<a href="javascript:addAttachment();">(+)</a>' . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('addhtmlpage', 'addhtmlpage', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '', 'content');
 }
Example #9
0
Get::title(array('index.php?r=' . $base_link_course . '/show' => Lang::t('_COURSE', 'course'), $id_course === false ? Lang::t('_NEW_COURSE', 'course') : Lang::t('_MOD', 'course') . ': ' . ($course['code'] !== '' ? '[' . $course['code'] . '] ' : '') . $course['name']));
?>
<div class="std_block">
	<?php 
echo Form::openForm('maskcourse_form', 'index.php?r=' . $base_link_course . '/' . ($id_course === false ? 'newcourse' : 'modcourse'), false, 'post', 'multipart/form-data') . Form::getHidden('id_course', 'id_course', $id_course) . Form::openElementSpace() . ($id_course === false ? Form::getLineBox(Lang::t('_CATEGORY_SELECTED', 'course'), $name_category) . Form::getHidden('idCategory', 'idCategory', $_SESSION['course_category']['filter_status']['id_category']) : Form::getDropdown(Lang::t('_CATEGORY_SELECTED', 'course'), 'idCategory', 'idCategory', $model->getCategoryForDropdown(), $course['idCategory'])) . Form::getTextfield(Lang::t('_CODE', 'course'), 'course_code', 'course_code', '50', $course['code']) . Form::getTextfield(Lang::t('_COURSE_NAME', 'course'), 'course_name', 'course_name', '255', $course['name']);
if ($course['course_type'] == 'classroom' && $has_editions_or_classrooms) {
    //this is a classroom course with editions
    echo Form::getLineBox(Lang::t('_COURSE_TYPE', 'course'), $course_type['classroom']) . Form::getHidden('course_type', 'course_type', 'classroom');
} elseif ($course['course_edition'] > 0 && $has_editions_or_classrooms) {
    //this is a classroom course with editions
    echo Form::getLineBox(Lang::t('_COURSE_TYPE', 'course'), $course_type['edition']) . Form::getHidden('course_type', 'course_type', 'edition');
} else {
    //echo Form::getDropdown(Lang::t('_COURSE_TYPE', 'course'), 'course_type', 'course_type', $course_type, $course['course_type']);
    echo Form::getDropdown(Lang::t('_COURSE_TYPE', 'course'), 'course_type', 'course_type', $course_type, $id_course === false ? 'elearning' : $course['course_type']);
}
echo Form::getDropdown(Lang::t('_STATUS', 'course'), 'course_status', 'course_status', $status, $course['status']) . Form::getCheckbox(Lang::t('_DIRECT_PLAY', 'course'), 'direct_play', 'direct_play', '1', $course['direct_play'] == 1) . Form::getTextarea(Lang::t('_DESCRIPTION', 'course'), 'course_descr', 'course_descr', $course['description']) . ($id_course !== false && $course['course_type'] != 'elearning' ? Form::getCheckbox(Lang::t('_CASCADE_MOD_ON_EDITION', 'course'), 'cascade_on_ed', 'cascade_on_ed', 1) : '') . Form::closeElementSpace() . Form::openElementSpace() . Form::openCollasableFieldset(Lang::t('_DETAILS', 'course')) . ($id_course === false ? Form::getDropdown(Lang::t('_COURSE_MENU_TO_ASSIGN', 'course'), 'selected_menu', 'selected_menu', $menu_custom, $sel_custom) : '') . Form::getDropdown(Lang::t('_COURSE_LANG_METHOD', 'course'), 'course_lang', 'course_lang', $array_lang, array_search($course['lang_code'], $array_lang)) . Form::getDropdown(Lang::t('_DIFFICULTY', 'course'), 'course_difficult', 'course_difficult', $difficult_lang, $course['difficult']) . Form::getTextfield(Lang::t('_CREDITS', 'course'), 'credits', 'credits', '50', $course['credits']) . Form::getDropdown(Lang::t('_LABELS', 'label'), 'label', 'label', $label_model->getLabelFromDropdown(true), $id_course === false ? false : $label_model->getCourseLabel($course['idCourse'])) . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_COURSE_SUBSCRIPTION', 'course')) . Form::getOpenCombo(Lang::t('_COURSE_SUBSRIBE', 'course')) . Form::getRadio(Lang::t('_COURSE_S_GODADMIN', 'course'), 'course_subs_godadmin', 'course_subs', '0', $course['subscribe_method'] == 0) . Form::getRadio(Lang::t('_COURSE_S_MODERATE', 'course'), 'course_subs_moderate', 'course_subs', '1', $course['subscribe_method'] == 1) . Form::getRadio(Lang::t('_COURSE_S_FREE', 'course'), 'course_subs_free', 'course_subs', '2', $course['subscribe_method'] == 2) . Form::getCloseCombo() . Form::getOpenCombo(Lang::t('_USER_CAN_SUBSCRIBE', 'course')) . Form::getRadio(Lang::t('_SUBSCRIPTION_CLOSED', 'course'), 'subscription_closed', 'can_subscribe', '0', $course['can_subscribe'] == 0) . Form::getRadio(Lang::t('_SUBSCRIPTION_OPEN', 'course'), 'subscription_open', 'can_subscribe', '1', $course['can_subscribe'] == 1) . Form::getRadio(Lang::t('_SUBSCRIPTION_IN_PERIOD', 'course') . ":", 'subscription_period', 'can_subscribe', '2', $course['can_subscribe'] == 2) . Form::getCloseCombo() . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_BEGIN', 'course') . ":", 'sub_start_date', 'sub_start_date', $course['sub_start_date']) . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_END', 'course') . ":", 'sub_end_date', 'sub_end_date', $course['sub_end_date']) . Form::getBreakRow() . Form::getOpenCombo(Lang::t('_USER_CAN_UNSUBSCRIBE', 'course')) . Form::getRadio(Lang::t('_COURSE_S_GODADMIN', 'course'), 'no_user_unsubscription', 'auto_unsubscribe', '0', $course['auto_unsubscribe'] == 0) . Form::getRadio(Lang::t('_COURSE_S_MODERATE', 'course'), 'moderated_user_unsubscription', 'auto_unsubscribe', '1', $course['auto_unsubscribe'] == 1) . Form::getRadio(Lang::t('_COURSE_S_FREE', 'course'), 'yes_user_unsubscription', 'auto_unsubscribe', '2', $course['auto_unsubscribe'] == 2) . Form::getCloseCombo() . Form::getDatefield(Lang::t('_UNSUBSCRIBE_DATE_LIMIT', 'course'), 'unsubscribe_date_limit', 'unsubscribe_date_limit', $unsubscribe_date_limit, FALSE, FALSE, '', '', Form::getInputCheckbox('use_unsubscribe_date_limit', 'use_unsubscribe_date_limit', 1, $use_unsubscribe_date_limit, '') . ' ') . Form::getBreakRow() . Form::getTextfield(Lang::t('_COURSE_AUTOREGISTRATION_CODE', 'course'), 'course_autoregistration_code', 'course_autoregistration_code', '255', $course['autoregistration_code']) . Form::getCheckbox(Lang::t('_RANDOM_COURSE_AUTOREGISTRATION_CODE', 'course'), 'random_course_autoregistration_code', 'random_course_autoregistration_code', 0) . Form::getBreakRow() . Form::getCheckbox(Lang::t('_COURSE_SELL', 'course'), 'course_sell', 'course_sell', '1', $course['selling'] == 1) . Form::getTextfield(Lang::t('_COURSE_PRIZE', 'course'), 'course_prize', 'course_prize', '11', $course['prize']) . Form::getTextfield(Lang::t('_COURSE_ADVANCE', 'course'), 'advance', 'advance', '11', $course['advance']) . Form::getHidden('course_em', 'course_em', '0') . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_COURSE_DISPLAY_MODE', 'course')) . Form::getOpenCombo(Lang::t('_WHERE_SHOW_COURSE', 'course')) . Form::getRadio(Lang::t('_SC_EVERYWHERE', 'course'), 'course_show_rules_every', 'course_show_rules', '0', $course['show_rules'] == 0) . Form::getRadio(Lang::t('_SC_ONLY_IN', 'course'), 'course_show_rules_only_in', 'course_show_rules', '1', $course['show_rules'] == 1) . Form::getRadio(Lang::t('_SC_ONLYINSC_USER', 'course'), 'course_show_rules_onlyinsc_user', 'course_show_rules', '2', $course['show_rules'] == 2) . Form::getCloseCombo() . Form::getOpenCombo(Lang::t('_WHAT_SHOW', 'course')) . Form::getCheckbox(Lang::t('_SHOW_PROGRESS', 'course'), 'course_progress', 'course_progress', '1', $course['show_progress'] == 1) . Form::getCheckbox(Lang::t('_SHOW_TIME', 'course'), 'course_time', 'course_time', '1', $course['show_time'] == 1) . Form::getCheckbox(Lang::t('_SHOW_ADVANCED_INFO', 'course'), 'course_advanced', 'course_advanced', '1', $course['show_extra_info'] == 1) . Form::getCloseCombo() . Form::getDropdown(Lang::t('_SHOW_WHOISONLINE', 'course'), 'show_who_online', 'show_who_online', $show_who_online, $course['show_who_online']) . Form::getOpenCombo(Lang::t('_SHOW_USER_OF_LEVEL', 'course'));
while (list($level, $level_name) = each($levels)) {
    echo Form::getCheckbox($level_name, 'course_show_level_' . $level, 'course_show_level[' . $level . ']', $level, $course['level_show_user'] & 1 << $level);
}
echo Form::getCloseCombo() . Form::getOpenCombo(Lang::t('_COURSE_STATUS_CANNOT_ENTER', 'course')) . Form::getCheckbox(Lang::t('_USER_STATUS_SUBS', 'course'), 'user_status_' . _CUS_SUBSCRIBED, 'user_status[' . _CUS_SUBSCRIBED . ']', _CUS_SUBSCRIBED, $course['userStatusOp'] & 1 << _CUS_SUBSCRIBED) . Form::getCheckbox(Lang::t('_USER_STATUS_BEGIN', 'course'), 'user_status_' . _CUS_BEGIN, 'user_status[' . _CUS_BEGIN . ']', _CUS_BEGIN, $course['userStatusOp'] & 1 << _CUS_BEGIN) . Form::getCheckbox(Lang::t('_USER_STATUS_END', 'course'), 'user_status_' . _CUS_END, 'user_status[' . _CUS_END . ']', _CUS_END, $course['userStatusOp'] & 1 << _CUS_END) . Form::getCheckbox(Lang::t('_USER_STATUS_SUSPEND', 'course'), 'user_status_' . _CUS_SUSPEND, 'user_status[' . _CUS_SUSPEND . ']', _CUS_SUSPEND, $course['userStatusOp'] & 1 << _CUS_SUSPEND) . Form::getCloseCombo() . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_COURSE_TIME_OPTION', 'course')) . Form::getDatefield(Lang::t('_DATE_BEGIN', 'course'), 'course_date_begin', 'course_date_begin', $course['date_begin']) . Form::getDatefield(Lang::t('_DATE_END', 'course'), 'course_date_end', 'course_date_end', $course['date_end']) . Form::getLineBox('<label for="hour_begin_hour">' . Lang::t('_HOUR_BEGIN', 'course') . '</label>', Form::getInputDropdown('dropdown_nw', 'hour_begin_hour', 'hour_begin[hour]', $hours, $hb_sel, '') . ' : ' . Form::getInputDropdown('dropdown_nw', 'hour_begin_quarter', 'hour_begin[quarter]', $quarter, $qe_sel, '')) . Form::getLineBox('<label for="hour_end_hour">' . Lang::t('_HOUR_END', 'course') . '</label>', Form::getInputDropdown('dropdown_nw', 'hour_end_hour', 'hour_end[hour]', $hours, $he_sel, '') . ' : ' . Form::getInputDropdown('dropdown_nw', 'hour_end_quarter', 'hour_end[quarter]', $quarter, $qe_sel, '')) . Form::getTextfield(Lang::t('_DAY_OF_VALIDITY', 'course'), 'course_day_of', 'course_day_of', '10', $course['valid_time']) . Form::getTextfield(Lang::t('_MEDIUM_TIME', 'course'), 'course_medium_time', 'course_medium_time', '10', $course['mediumTime']) . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_COURSE_SPECIAL_OPTION', 'course')) . Form::getTextfield(Lang::t('_MIN_NUM_SUBSCRIBE', 'course'), 'min_num_subscribe', 'min_num_subscribe', '11', $course['min_num_subscribe']) . Form::getTextfield(Lang::t('_MAX_NUM_SUBSCRIBE', 'course'), 'max_num_subscribe', 'max_num_subscribe', '11', $course['max_num_subscribe']) . Form::getCheckbox(Lang::t('_ALLOW_OVERBOOKING', 'course'), 'allow_overbooking', 'allow_overbooking', '1', $course['allow_overbooking'] == 1) . Form::getTextfield(Lang::t('_COURSE_QUOTA', 'course'), 'course_quota', 'course_quota', '11', $course['course_quota'] != COURSE_QUOTA_INHERIT ? $course['course_quota'] : 0) . Form::getCheckbox(Lang::t('_INHERIT_QUOTA', 'course'), 'inherit_quota', 'inherit_quota', '1', $course['course_quota'] == COURSE_QUOTA_INHERIT) . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_DOCUMENT_UPLOAD', 'course')) . Form::getTextfield(Lang::t('_SPONSOR_LINK', 'course'), 'course_sponsor_link', 'course_sponsor_link', '255', $course['linkSponsor']) . Form::getExtendedFilefield(Lang::t('_PATHSPONSOR', 'configuration'), 'course_sponsor_logo', 'course_sponsor_logo', $course["imgSponsor"]) . Form::getExtendedFilefield(Lang::t('_COURSE_LOGO', 'course'), 'course_logo', 'course_logo', $course["img_course"]) . Form::getExtendedFilefield(Lang::t('_COURSE_DEMO', 'course'), 'course_demo', 'course_demo', $course["course_demo"]) . Form::getCheckbox(Lang::t('_USE_LOGO_IN_COURSELIST', 'course'), 'use_logo_in_courselist', 'use_logo_in_courselist', 1, $course["use_logo_in_courselist"]) . Form::getCloseFieldset() . Form::closeElementSpace() . Form::openButtonSpace() . ($_REQUEST['r'] == 'alms/course/newcourse' || $_REQUEST['r'] == 'alms/course/modcourse' && $row[0] == 0 ? Form::getCheckbox(Lang::t('_AUTO_SUBSCRIPTION'), 'auto_subscription', 'auto_subscription', '1', true) : '') . Form::getButton('save', 'save', Lang::t('_SAVE')) . Form::getButton('undo', 'undo', Lang::t('_UNDO')) . Form::closeButtonSpace() . Form::closeForm();
?>
</div>
<script type="text/javascript">
var D = YAHOO.util.Dom, E = YAHOO.util.Event;
E.onDOMReady(function() {
	var c = D.get("use_unsubscribe_date_limit"), d = D.get("unsubscribe_date_limit");
	E.addListener("no_user_unsubscription", "click", function(e) {
		var checked = this.checked;
		c.disabled = checked;
		d.disabled = checked;
	});
Example #10
0
 function mancatalogue($load_id = false)
 {
     checkPerm('mod');
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('catalogue', 'lms');
     $out =& $GLOBALS['page'];
     $title_area = array('index.php?modname=catalogue&amp;op=catlist' => $lang->def('_CATALOGUE'));
     if ($load_id === false) {
         $title_area[] = $lang->def('_NEW_CATALOGUE');
         $name = '';
         $description = '';
     } else {
         $title_area[] = $lang->def('_MOD');
         // Retriving data
         $query_catalogue = "\r\n\t\tSELECT name, description\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_catalogue\r\n\t\tWHERE idCatalogue = '" . (int) $load_id . "'";
         list($name, $description) = sql_fetch_row(sql_query($query_catalogue));
     }
     $out->add(getTitleArea($title_area, 'catalogue') . '<div class="std_block">' . Form::openForm('mancatalogue', 'index.php?modname=catalogue&amp;op=savecatalogue') . ($load_id === false ? '' : Form::getHidden('id_cat', 'id_cat', $load_id)) . Form::openElementSpace() . Form::getTextfield($lang->def('_NAME'), 'name', 'name', 255, $name) . Form::getTextarea($lang->def('_DESCRIPTION'), 'description', 'description', $description) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
 }
 function edit($back_test)
 {
     $lang =& DoceboLanguage::createInstance('test');
     require_once _base_ . '/lib/lib.form.php';
     $url_encode = htmlentities(urlencode($back_test));
     if (isset($_POST['add_question'])) {
         if (!sql_query("\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_testquest \r\n\t\t\tSET idCategory = '" . (int) $_POST['idCategory'] . "', \r\n\t\t\t\ttitle_quest = '" . $_POST['title_quest'] . "', \r\n\t\t\t\tdifficult = '" . (int) $_POST['difficult'] . "', \r\n\t\t\t\ttime_assigned = '" . (int) $_POST['time_assigned'] . "' \r\n\t\t\tWHERE idQuest = '" . $this->id . "'")) {
             errorCommunication($lang->def('_ERR_INS_QUEST') . getBackUi('index.php?modname=question&amp;op=edit&amp;type_quest=' . $this->getQuestionType() . '&amp;idQuest=' . $this->id . '&amp;back_test=' . $url_encode, $lang->def('_BACK')));
         }
         if (!sql_query("\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_testquestanswer \r\n\t\t\tSET score_correct = '" . $this->_checkScore($_POST['max_score']) . "'\r\n\t\t\tWHERE idQuest = '" . $this->id . "'")) {
             errorCommunication($lang->def('_ERR_INS_QUEST') . getBackUi('index.php?modname=question&amp;op=edit&amp;type_quest=' . $this->getQuestionType() . '&amp;idQuest=' . $this->id . '&amp;back_test=' . $url_encode, $lang->def('_BACK')));
         }
         Util::jump_to('' . $back_test);
     }
     //finding categories
     require_once $GLOBALS['where_lms'] . '/lib/lib.questcategory.php';
     $categories = Questcategory::getCategory();
     //create array of difficult
     $arr_dufficult = array(5 => '5 - ' . $lang->def('_VERY_HARD'), 4 => '4 - ' . $lang->def('_HARD'), 3 => '3 - ' . $lang->def('_DIFFICULT_MEDIUM'), 2 => '2 - ' . $lang->def('_DIFFICULT_EASY'), 1 => '1 - ' . $lang->def('_DIFFICULT_VERYEASY'));
     list($title_quest, $cat_sel, $diff_sel, $sel_time) = sql_fetch_row(sql_query("\r\n\t\tSELECT title_quest, idCategory, difficult, time_assigned \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_testquest \r\n\t\tWHERE idQuest = '" . $this->id . "'"));
     list($max_score) = sql_fetch_row(sql_query("\r\n\t\tSELECT score_correct\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_testquestanswer \r\n\t\tWHERE idQuest = '" . $this->id . "'"));
     $GLOBALS['page']->add(getTitleArea($lang->def('_TEST_SECTION'), 'test') . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&amp;', $back_test), $lang->def('_BACK')) . '<div class="title_big">' . $lang->def('_QUEST_ACRN_' . strtoupper($this->getQuestionType())) . ' - ' . $lang->def('_QUEST_' . strtoupper($this->getQuestionType())) . '</div><br />' . Form::openForm('form_mod_quest', 'index.php?modname=question&amp;op=edit') . Form::openElementSpace() . Form::getHidden('type_quest', 'type_quest', $this->getQuestionType()) . Form::getHidden('idQuest', 'idQuest', $this->id) . Form::getHidden('back_test', 'back_test', $url_encode) . Form::getTextarea($lang->def('_QUESTION'), 'title_quest', 'title_quest', $title_quest), 'content');
     if (count($categories) > 1) {
         $GLOBALS['page']->add(Form::getDropdown($lang->def('_TEST_QUEST_CATEGORY'), 'idCategory', 'idCategory', $categories, isset($_POST['idCategory']) ? $_POST['idCategory'] : $cat_sel), 'content');
     }
     $GLOBALS['page']->add(Form::getDropdown($lang->def('_DIFFICULTY'), 'difficult', 'difficult', $arr_dufficult, $diff_sel) . Form::getTextfield($lang->def('_TEST_QUEST_TIMEASS'), 'time_assigned', 'time_assigned', 5, isset($_POST['time_assigned']) ? $_POST['time_assigned'] : $sel_time, $lang->def('_TEST_QUEST_TIMEASS'), $lang->def('_SECONDS')) . Form::getBreakRow() . Form::getTextfield($lang->def('_MAX_SCORE'), 'max_score', 'max_score', 255, isset($_POST['max_score']) ? $_POST['max_score'] : $max_score, $lang->def('_MAX_SCORE')) . Form::getBreakRow() . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('add_question', 'add_question', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
 }
Example #12
0
<?php

echo getTitleArea(array('index.php?r=alms/games/show' => Lang::t('_CONTEST', 'games'), Lang::t('_ADD', 'games')));
?>
<div class="std_block">
	<?php 
echo Form::openForm('add_games', 'index.php?r=alms/games/insert', false, false, 'multipart/form-data') . Form::getHidden('title', 'title', 255, Get::req('title', DOTY_MIXED, $data['title'])) . Form::openElementSpace() . Form::getTextfield(Lang::t('_TITLE', 'games'), 'title', 'title', 255, Get::req('title', DOTY_MIXED, $data['title'])) . Form::getDatefield(Lang::t('_START_DATE', 'games'), 'start_date', 'start_date', Get::req('start_date', DOTY_MIXED, $data['start_date'])) . Form::getDatefield(Lang::t('_DATE_END', 'games'), 'end_date', 'end_date', Get::req('end_date', DOTY_MIXED, $data['end_date'])) . Form::getRadioSet(Lang::t('_TYPE', 'games'), 'type_of', 'type_of', array(Lang::t('_LONAME_scormorg', 'storage') => 'scorm'), Get::req('type_of', DOTY_STRING, $data['type_of'])) . Form::getRadioSet(Lang::t('_PLAY_CHANCE', 'games'), 'play_chance', 'play_chance', array(Lang::t('_UNLIMITED', 'games') => 'play_unlimited', Lang::t('_ONLY_ONCE', 'games') => 'play_once'), 'play_unlimited') . Form::getTextarea(Lang::t('_DESCRIPTION', 'games'), 'description', 'description', Get::req('description', DOTY_MIXED, $data['description'])) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', Lang::t('_SAVE', 'games')) . Form::getButton('undo', 'undo', Lang::t('_UNDO', 'games')) . Form::closeButtonSpace() . Form::closeForm();
?>
</div>
 function show_report_LO($report_data = NULL, $other = '')
 {
     $jump_url = '';
     //show_report
     checkPerm('view');
     $lang =& DoceboLanguage::createInstance('report', 'framework');
     if (isset($_POST['send_mail_confirm'])) {
         $op = 'send_mail_confirm';
     } elseif (isset($_POST['send_mail'])) {
         $op = 'send_mail';
     } else {
         $op = 'show_result';
     }
     switch ($op) {
         case 'send_mail_confirm':
             $subject = importVar('mail_object', false, '[' . $lang->def('_SUBJECT') . ']');
             //'[No subject]');
             $body = importVar('mail_body', false, '');
             $acl_man = new DoceboACLManager();
             $user_info = $acl_man->getUser(getLogUserId(), false);
             if ($user_info) {
                 $sender = $user_info[ACL_INFO_EMAIL];
             }
             $mail_recipients = unserialize(urldecode(Get::req('mail_recipients', DOTY_STRING, '')));
             // prepare intestation for email
             $from = "From: " . $sender . $GLOBALS['mail_br'];
             $header = "MIME-Version: 1.0" . $GLOBALS['mail_br'] . "Content-type: text/html; charset=" . getUnicode() . $GLOBALS['mail_br'];
             $header .= "Return-Path: " . Get::sett('sender_event') . $GLOBALS['mail_br'];
             $header .= "Reply-To: " . Get::sett('sender_event') . $GLOBALS['mail_br'];
             $header .= "X-Sender: " . Get::sett('sender_event') . $GLOBALS['mail_br'];
             $header .= "X-Mailer: PHP/" . phpversion() . $GLOBALS['mail_br'];
             // send mail
             $arr_recipients = array();
             foreach ($mail_recipients as $recipient) {
                 $rec_data = $acl_man->getUser($recipient, false);
                 //mail($rec_data[ACL_INFO_EMAIL] , stripslashes($subject), stripslashes(nl2br($body)), $from.$header."\r\n");
                 $arr_recipients[] = $rec_data[ACL_INFO_EMAIL];
             }
             $mailer = DoceboMailer::getInstance();
             $mailer->SendMail($sender, $arr_recipients, stripslashes($subject), stripslashes(nl2br($body)));
             $result = getResultUi($lang->def('_OPERATION_SUCCESSFUL'));
             cout($this->_get_LO_query('html', NULL, $result));
             break;
         case 'send_mail':
             require_once _base_ . '/lib/lib.form.php';
             $mail_recipients = Get::req('mail_recipients', DOTY_MIXED, array());
             cout('' . Form::openElementSpace() . Form::getTextfield($lang->def('_SUBJECT'), 'mail_object', 'mail_object', 255) . Form::getTextarea($lang->def('_MAIL_BODY'), 'mail_body', 'mail_body') . Form::getHidden('mail_recipients', 'mail_recipients', urlencode(serialize($mail_recipients))) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('send_mail_confirm', 'send_mail_confirm', $lang->def('_SEND_MAIL')) . Form::getButton('undo_mail', 'undo_mail', $lang->def('_UNDO')) . Form::closeButtonSpace() . '</div>', 'content');
             break;
         default:
             cout($this->_get_LO_query('html', $report_data, $other));
     }
 }
Example #14
0
function modadvice()
{
    checkPerm('mod');
    require_once _base_ . '/lib/lib.form.php';
    $lang =& DoceboLanguage::createInstance('advice');
    $form = new Form();
    $query_advice = "\r\n\t\tSELECT title, description, important\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_advice\r\n\t\tWHERE idAdvice='" . (int) $_GET['idAdvice'] . "'";
    list($title, $description, $impo) = sql_fetch_row(sql_query($query_advice));
    $page_title = array('index.php?modname=advice&amp;op=advice' => $lang->def('_ADVICE'), $lang->def('_MOD'));
    $GLOBALS['page']->add(getTitleArea($page_title, 'advice') . '<div class="std_block">' . getBackUi('index.php?modname=advice&amp;op=advice', $lang->def('_BACK')) . $form->openForm('adviceform', 'index.php?modname=advice&amp;op=upadvice') . $form->openElementSpace() . $form->getHidden('idAdvice', 'idAdvice', $_GET['idAdvice']) . $form->getTextfield($lang->def('_TITLE'), 'title', 'title', 60, $title) . $form->getCheckbox($lang->def('_MARK_AS_IMPORTANT'), 'impo', 'impo', 1, $impo) . $form->getTextarea($lang->def('_DESCRIPTION'), 'description', 'description', $description) . $form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('addadvice', 'addadvice', $lang->def('_SAVE')) . $form->getButton('undo', 'undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm() . '</div>', 'content');
}
Example #15
0
function editcertificate($load = false)
{
    checkPerm('mod');
    require_once _base_ . '/lib/lib.form.php';
    $lang =& DoceboLanguage::createInstance('certificate', 'lms');
    $form = new Form();
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    $id_certificate = importVar('id_certificate', true, 0);
    $all_languages = Docebo::langManager()->getAllLanguages();
    $languages = array();
    foreach ($all_languages as $k => $v) {
        $languages[$v[0]] = $v[1];
    }
    if ($load) {
        $query_certificate = "\r\n\t\tSELECT code, name, base_language, description, user_release\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_certificate\r\n\t\tWHERE id_certificate = '" . $id_certificate . "'";
        list($code, $name, $base_language, $descr, $user_release) = sql_fetch_row(sql_query($query_certificate));
    } else {
        $code = '';
        $name = '';
        $descr = '';
        $user_release = 1;
        $base_language = getLanguage();
    }
    $page_title = array('index.php?modname=certificate&amp;op=certificate' => $lang->def('_TITLE_CERTIFICATE'), $load ? $lang->def('_MOD') : $lang->def('_NEW_CERTIFICATE'));
    $out->add(getTitleArea($page_title, 'certificate') . '<div class="std_block">' . getBackUi('index.php?modname=certificate&amp;op=certificate', $lang->def('_BACK')) . $form->openForm('adviceform', 'index.php?modname=certificate&amp;op=savecertificate'));
    if ($load) {
        $out->add($form->getHidden('id_certificate', 'id_certificate', $id_certificate) . $form->getHidden('load', 'load', 1));
    }
    $out->add($form->openElementSpace() . $form->getTextfield($lang->def('_CODE'), 'code', 'code', 255, $code) . $form->getTextfield($lang->def('_NAME'), 'name', 'name', 255, $name) . Form::getDropdown($lang->def('_BASE_LANGUAGE'), 'base_language', 'base_language', $languages, $base_language) . $form->getCheckbox($lang->def('_USER_RELEASE'), 'user_release', 'user_release', '1', $user_release) . $form->getTextarea($lang->def('_DESCRIPTION'), 'descr', 'descr', $descr) . $form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('certificate', 'certificate', $load ? $lang->def('_SAVE') : $lang->def('_INSERT')) . $form->getButton('undo', 'undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm() . '</div>');
}
Example #16
0
function editnews($load = false)
{
    checkPerm('mod');
    require_once _base_ . '/lib/lib.form.php';
    $lang =& DoceboLanguage::createInstance('admin_news', 'lms');
    $form = new Form();
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    $id_news = importVar('id_news', true, 0);
    $all_languages = array('-1' => Lang::t('_ALL', 'standard'));
    $all_languages += Docebo::langManager()->getAllLangCode();
    if ($load) {
        $query_news = "\r\n\t\tSELECT title, short_desc, long_desc, important, language\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_news_internal\r\n\t\tWHERE idNews = '" . $id_news . "'";
        list($title, $short_desc, $long_desc, $impo, $lang_sel) = sql_fetch_row(sql_query($query_news));
    } else {
        $title = $lang->def('_NOTITLE');
        $short_desc = '';
        $long_desc = '';
        $impo = 0;
        $lang_sel = getLanguage();
    }
    $page_title = array('index.php?modname=internal_news&amp;op=news' => $lang->def('_NEWS'), $load ? $lang->def('_MOD') : $lang->def('_NEW'));
    $out->add(getTitleArea($page_title, 'news') . '<div class="std_block">' . getBackUi('index.php?modname=internal_news&amp;op=news', $lang->def('_BACK')) . $form->openForm('adviceform', 'index.php?modname=internal_news&amp;op=savenews'));
    if ($load) {
        $out->add($form->getHidden('id_news', 'id_news', $id_news) . $form->getHidden('load', 'load', 1));
    }
    $out->add($form->openElementSpace() . $form->getTextfield($lang->def('_TITLE'), 'title', 'title', 255, $title) . $form->getCheckbox($lang->def('_MARK_AS_IMPORTANT'), 'impo', 'impo', 1, $impo) . $form->getDropdown($lang->def('_LANGUAGE'), 'language', 'language', $all_languages, $lang_sel === 'all' ? -1 : array_search($lang_sel, $all_languages)) . $form->getTextarea($lang->def('_SHORTDESC'), 'short_desc', 'short_desc', $short_desc) . $form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('news', 'news', $load ? $lang->def('_SAVE') : $lang->def('_INSERT')) . $form->getButton('undo', 'undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm() . '</div>');
}
Example #17
0
function editgroup()
{
    checkPerm('mod');
    require_once _base_ . '/lib/lib.form.php';
    $acl_man =& Docebo::user()->getAclManager();
    $lang =& DoceboLanguage::createInstance('groups', 'lms');
    if (isset($_GET['id_group'])) {
        $acl_man->setContext('/lms/course/' . $_SESSION['idCourse'] . '/group');
        $group = $acl_man->getGroup($_GET['id_group'], false);
        $group_name = $acl_man->relativeId($group[ACL_INFO_GROUPID]);
        $group_descr = $group[ACL_INFO_GROUPDESCRIPTION];
    } else {
        $group_name = '';
        $group_descr = '';
    }
    $page_title = array('index.php?modname=groups&amp;op=groups' => $lang->def('_GROUPS'), isset($_GET['id_group']) ? $lang->def('_MOD') . ' : ' . $group_name : $lang->def('_CREATE'));
    $GLOBALS['page']->add(getTitleArea($page_title, 'groups') . '<div class="std_block">' . getBackUi('index.php?modname=groups&amp;op=groups', $lang->def('_BACK')) . Form::openForm('new_groups', 'index.php?modname=groups&amp;op=savegroup') . Form::openElementSpace() . (isset($_GET['id_group']) ? Form::getHidden('id_group', 'id_group', $_GET['id_group']) : '') . Form::getTextfield($lang->def('_NAME'), 'group_groupid', 'group[groupid]', 255, $group_name) . Form::getTextarea($lang->def('_DESCRIPTION'), 'group_description', 'group_description', $group_descr) . Form::closeElementSpace() . Form::openButtonSpace() . form::getButton('save', 'save', $lang->def('_SAVE')) . form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
}
Example #18
0
<?php

echo getTitleArea(array('index.php?r=alms/communication/show' => Lang::t('_COMMUNICATIONS', 'communication'), Lang::t('_ADD', 'communication')));
?>
<div class="std_block">
<?php 
echo Form::openForm('add_comm', 'index.php?r=alms/communication/insert', false, false, 'multipart/form-data') . Form::getHidden('title', 'title', 255, Get::req('title', DOTY_MIXED, $data['title'])) . Form::openElementSpace() . Form::getTextfield(Lang::t('_TITLE', 'communication'), 'title', 'title', 255, Get::req('title', DOTY_MIXED, $data['title'])) . Form::getDatefield(Lang::t('_DATE', 'communication'), 'publish_date', 'publish_date', Get::req('publish_date', DOTY_MIXED, $data['publish_date'])) . Form::getRadioSet(Lang::t('_TYPE', 'communication'), 'type_of', 'type_of', array(Lang::t('_NONE', 'communication') => 'none', Lang::t('_LONAME_item', 'storage') => 'file', Lang::t('_LONAME_scormorg', 'storage') => 'scorm'), Get::req('type_of', DOTY_STRING, $data['type_of'])) . Form::getTextarea(Lang::t('_DESCRIPTION', 'communication'), 'description', 'description', Get::req('description', DOTY_MIXED, $data['description'])) . '<div class="quick_search_form qsf_left">' . '<div class="form_line_l">' . '<label class="label_effect" for="set_course">' . Lang::t('_COURSE', 'course') . '</label>&nbsp;' . Form::getInputTextfield('search_t', 'set_course', 'set_course', '', '', 255, '') . '<div id="set_course_container"></div>' . '</div>' . '</div>' . Form::getHidden('id_course', 'id_course', $data['id_course']) . Form::getHidden('id_category', 'id_category', $data['id_category']) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', Lang::t('_SAVE', 'communication')) . Form::getButton('undo', 'undo', Lang::t('_UNDO', 'communication')) . Form::closeButtonSpace() . Form::closeForm();
?>
</div>
<script type="text/javascript">
//courses autocomplete
YAHOO.util.Event.onDOMReady(function() {
	var oDS = new YAHOO.util.XHRDataSource('ajax.adm_server.php?mn=course&plf=lms&op=course_autocomplete');
	oDS.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;
	oDS.responseSchema = {
		resultsList : "courses",
		fields: ["cname", "id_course", "code", "name", "code_highlight", "name_highlight", "has_editions", "editions", "has_classrooms", "classrooms"]
	};

	var oAC = new YAHOO.widget.AutoComplete("set_course", "set_course_container", oDS);
	oAC.forceSelection = true;
	oAC.useShadow = true;
	oAC.resultTypeList = false;
	oAC.formatResult = function(oResultData, sQuery, sResultMatch) {
		return (oResultData.code_highlight != "" ? '['+oResultData.code_highlight+'] ' : '')+oResultData.name_highlight;
	};
	oAC.itemSelectEvent.subscribe(function(sType, oArgs) {
		var D = YAHOO.util.Dom;
		D.get('id_course').value = oArgs[2].id_course;
	});
	oAC.generateRequest = function(sQuery) { return "&results=20&query=" + sQuery; };
Example #19
0
 function modTeacherPublicationsGui()
 {
     require_once _base_ . '/lib/lib.form.php';
     $html = '<div class="up_user_info">' . '<div class="up_name">' . $this->resolveUsername(false, getLogUserId()) . '</div>';
     // user standard info -----------------------------------------------------------------
     $html .= Form::openForm('mod_publications', $this->_url_man->getUrl($this->_varname_action . '=save_teach_publ'));
     $html .= Form::getTextarea($this->_lang->def('_TEACHER_PUBLICATIONS'), 'tp_publications', 'tp_publications', Get::req('tp_publications', DOTY_MIXED, $this->_up_data_man->getTeacherPublications($this->_user_profile->getIdUser())));
     $html .= Form::openButtonSpace() . Form::getButton('save', 'save', $this->_lang->def('_SAVE')) . Form::getButton('undo', 'undo', $this->_lang->def('_UNDO')) . Form::closeButtonSpace();
     $html .= Form::closeForm() . '</div>';
     return $html;
 }
Example #20
0
function editpages($load = false)
{
    checkPerm('mod');
    require_once _base_ . '/lib/lib.form.php';
    $lang =& DoceboLanguage::createInstance('admin_webpages', 'lms');
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    $all_languages = Docebo::langManager()->getAllLangCode();
    $id_page = importVar('id_page', true, 0);
    if ($load) {
        $query_page = "\r\n\t\tSELECT title, description, language, publish, in_home\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_webpages \r\n\t\tWHERE idPages = '" . $id_page . "'";
        list($title, $description, $language, $publish, $in_home) = sql_fetch_row(sql_query($query_page));
    } else {
        $title = $lang->def('_NOTITLE');
        $description = '';
        $language = getLanguage();
        $publish = 0;
        $in_home = 0;
    }
    $page_title = array('index.php?modname=webpages&amp;op=webpages' => $lang->def('_TITLE_WEBPAGES'), $load ? $lang->def('_MOD') : $lang->def('_ADD_WEBPAGES'));
    $out->add(getTitleArea($page_title, 'webpages') . '<div class="std_block">' . getBackUi('index.php?modname=webpages&amp;op=webpages', $lang->def('_BACK')) . Form::openForm('nav_webpages', 'index.php?modname=webpages&amp;op=savepages') . Form::openElementSpace());
    if ($load) {
        $out->add(Form::getHidden('load', 'load', 1) . Form::getHidden('id_page', 'id_page', $id_page));
    }
    $out->add(Form::getTextfield($lang->def('_TITLE'), 'title', 'title', 255, $title) . Form::getDropdown($lang->def('_LANGUAGE'), 'language', 'language', $all_languages, array_search($language, $all_languages)) . Form::getCheckbox($lang->def('_PUBLISH'), 'publish', 'publish', 1, $publish) . Form::getCheckbox($lang->def('_TITLE_HOME'), 'in_home', 'in_home', 1, $in_home) . Form::getTextarea($lang->def('_DESCRIPTION'), 'description', 'description', $description) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>');
}
 /**
  * this function modify a question
  *
  * @param  string	$back_poll	indicates the return url
  * @return nothing
  *
  * @access public
  * @author Fabio Pirovano (fabio@docebo.com)
  */
 function edit($back_poll)
 {
     $lang =& DoceboLanguage::createInstance('poll');
     require_once _base_ . '/lib/lib.form.php';
     $url_encode = htmlentities(urlencode($back_poll));
     //manage number of answer
     if (isset($_POST['save_question'])) {
         //update question
         $ins_query = "\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_pollquest\r\n\t\t\tSET id_category = '" . (int) $_POST['id_category'] . "',\r\n\t\t\t\ttype_quest = '" . $this->getQuestionType() . "',\r\n\t\t\t\ttitle_quest = '" . $_POST['title_quest'] . "'\r\n\t\t\tWHERE id_quest = '" . (int) $this->id . "'";
         if (!sql_query($ins_query)) {
             getErrorUi($lang->def('_POLL_ERR_INS_QUEST') . getBackUi('index.php?modname=question_poll&amp;op=edit&amp;type_quest=' . $this->getQuestionType() . '&amp;id_quest=' . $this->id . '&amp;back_poll=' . $url_encode, $lang->def('_BACK')));
         }
         //update answer
         if (!isset($_POST['is_correct'])) {
             $_POST['is_correct'] = -1;
         }
         $min_value = Get::req('min_value', DOTY_INT, 0);
         $max_value = Get::req('max_value', DOTY_INT, 0);
         $step_value = (double) str_replace(',', '.', $_POST['step_value']);
         if ($min_value >= $max_value || $step_value == 0) {
             $GLOBALS['page']->add(getErrorUi($lang->def('_POLL_ERR_INS_ANSWER') . getBackUi(str_replace('&', '&amp;', $back_poll), $lang->def('_BACK'))), 'content');
         } else {
             $del_answer_query = "DELETE FROM " . $GLOBALS['prefix_lms'] . "_pollquestanswer\r\n\t\t\t\t\t\t\t\t\tWHERE id_quest = '" . (int) $this->id . "'";
             if (!sql_query($del_answer_query)) {
                 getErrorUi($lang->def('_POLL_ERR_INS_ANSWER') . getBackUi(str_replace('&', '&amp;', $back_poll), $lang->def('_BACK')));
             } else {
                 $query = "INSERT INTO " . $GLOBALS['prefix_lms'] . "_pollquestanswer" . " (id_quest, answer, sequence)" . " VALUES ('" . $this->id . "', '" . $min_value . "', '0')," . " ('" . $this->id . "', '" . $max_value . "', '1')," . " ('" . $this->id . "', '" . $step_value . "', '2');";
                 if (!sql_query($query)) {
                     getErrorUi($lang->def('_POLL_ERR_INS_ANSWER') . getBackUi(str_replace('&', '&amp;', $back_poll), $lang->def('_BACK')));
                 } else {
                     Util::jump_to($back_poll);
                 }
             }
         }
     }
     //insert form
     require_once _lms_ . '/lib/lib.questcategory.php';
     $categories = Questcategory::getCategory();
     //writing difficult
     //load data
     list($sel_cat, $quest) = sql_fetch_row(sql_query("\r\n\t\tSELECT id_category, title_quest\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_pollquest\r\n\t\tWHERE id_quest = '" . (int) $this->id . "'"));
     $re_answer = sql_query("\r\n\t\tSELECT id_answer, answer\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_pollquestanswer\r\n\t\tWHERE id_quest = '" . (int) $this->id . "'\r\n\t\tORDER BY sequence");
     $array_answer = array();
     while (list($id_answer, $answer) = sql_fetch_row($re_answer)) {
         $array_answer[] = $answer;
     }
     if (!empty($array_answer)) {
         $min_value = $array_answer[0];
         $max_value = $array_answer[1];
         $step_value = $array_answer[2];
     } else {
         $min_value = '';
         $max_value = '';
         $step_value = '1';
     }
     $GLOBALS['page']->add(getTitleArea($lang->def('_POLL_SECTION'), 'poll') . '<div class="std_block">' . getBackUi(str_replace('&', '&amp;', $back_poll), $lang->def('_BACK')) . '<div class="title_big">' . $lang->def('_QUEST_ACRN_' . strtoupper($this->getQuestionType())) . ' - ' . $lang->def('_QUEST_' . strtoupper($this->getQuestionType())) . '</div><br />' . Form::openForm('form_add_quest', 'index.php?modname=question_poll&amp;op=edit') . Form::openElementSpace() . Form::getHidden('type_quest', 'type_quest', $this->getQuestionType()) . Form::getHidden('id_quest', 'id_quest', $this->id) . Form::getHidden('back_poll', 'back_poll', $url_encode) . Form::getTextarea($lang->def('_POLL_QUEST_TITLE'), 'title_quest', 'title_quest', isset($_POST['title_quest']) ? stripslashes($_POST['title_quest']) : $quest) . Form::getDropdown($lang->def('_CATEGORY'), 'id_category', 'id_category', $categories, isset($_POST['id_category']) ? $_POST['id_category'] : $sel_cat) . '<div class="no_float"></div><br />' . Form::getTextfield($lang->def('_MIN_VALUE'), 'min_value', 'min_value', 255, $min_value) . Form::getTextfield($lang->def('_MAX_VALUE'), 'max_value', 'max_value', 255, $max_value) . Form::getTextfield($lang->def('_STEP_VALUE'), 'step_value', 'step_value', 255, $step_value), 'content');
     $GLOBALS['page']->add(Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save_question', 'save_question', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
 }
Example #22
0
function modCourseEdition()
{
    checkPerm('mod');
    require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
    require_once _base_ . '/lib/lib.form.php';
    require_once _base_ . '/lib/lib.tab.php';
    require_once $GLOBALS['where_lms'] . '/lib/lib.manmenu.php';
    $lang =& DoceboLanguage::createInstance('course', 'lms');
    $form = new Form();
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    $course_status = array(CST_PREPARATION => $lang->def('_CST_PREPARATION'), CST_AVAILABLE => $lang->def('_CST_AVAILABLE'), CST_EFFECTIVE => $lang->def('_CST_CONFIRMED'), CST_CONCLUDED => $lang->def('_CST_CONCLUDED'), CST_CANCELLED => $lang->def('_CST_CANCELLED'));
    //type of edition
    $edition_type = array('elearning' => $lang->def('_COURSE_TYPE_ELEARNING'), 'blended' => $lang->def('_COURSE_TYPE_BLENDED'), 'classroom' => $lang->def('_CLASSROOM'));
    list($id_course_edition) = each($_POST['mod_course_edition']);
    $query_course_edition = "\r\n\tSELECT *\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course_edition\r\n\tWHERE idCourseEdition = '" . $id_course_edition . "'";
    $course_edition = mysql_fetch_assoc(sql_query($query_course_edition));
    // set page title
    $title_area = array('index.php?modname=course&amp;op=course_list' => $lang->def('_COURSE'), $lang->def('_MOD') . ' : ' . $course_edition['name']);
    $date_begin = Format::date($course_edition['date_begin'], 'date');
    $date_end = Format::date($course_edition['date_end'], 'date');
    $out->add(getTitleArea($title_area, 'configuration') . '<div class="std_block">' . $form->openForm('upd_course', 'index.php?modname=course&amp;op=upd_course', false, false, 'multipart/form-data') . $form->getHidden('mod_course_edition' . $id_course_edition, 'mod_course_edition[' . $id_course_edition . ']', $id_course_edition) . $form->getHidden("course_id", "course_id", $course_edition["idCourse"]) . $form->getHidden("old_date_begin", "old_date_begin", $course_edition['date_begin']) . $form->getHidden("old_date_end", "old_date_end", $course_edition['date_end']));
    $out->add($form->openElementSpace() . $form->getTextfield($lang->def('_CODE'), 'course_edition_code', 'course_edition_code', '50', $course_edition['code']) . $form->getTextfield($lang->def('_COURSE_NAME'), 'course_edition_name', 'course_edition_name', '255', $course_edition['name']) . $form->getDropdown($lang->def('_STATUS'), 'course_edition_status', 'course_edition_status', $course_status, $course_edition['status']) . $form->getDropdown($lang->def('_COURSE_TYPE'), 'edition_type', 'edition_type', $edition_type, $course_edition['edition_type']) . $form->getTextarea($lang->def('_DESCRIPTION'), 'course_edition_descr', 'course_edition_descr', $course_edition['description']));
    $out->add($form->getOpenFieldset($lang->def('_COURSE_SUBSCRIPTION')) . $form->getOpenCombo($lang->def('_USER_CAN_SUBSCRIBE')) . $form->getRadio($lang->def('_SUBSCRIPTION_CLOSED'), 'subscription_closed', 'can_subscribe', '0', $course_edition['can_subscribe'] == 0) . $form->getRadio($lang->def('_SUBSCRIPTION_OPEN'), 'subscription_open', 'can_subscribe', '1', $course_edition['can_subscribe'] == 1) . $form->getRadio($lang->def('_SUBSCRIPTION_IN_PERIOD') . ":", 'subscription_period', 'can_subscribe', '2', $course_edition['can_subscribe'] == 2) . $form->getCloseCombo() . $form->getDatefield($lang->def('_SUBSCRIPTION_DATE_BEGIN') . ":", 'sub_start_date', 'sub_start_date', Format::date($course_edition['sub_start_date'], "date")) . $form->getDatefield($lang->def('_SUBSCRIPTION_DATE_END') . ":", 'sub_end_date', 'sub_end_date', Format::date($course_edition['sub_end_date'], "date")) . $form->getCloseFieldset());
    $out->add($form->getOpenFieldset($lang->def('_COURSE_SPECIAL_OPTION')) . $form->getTextfield($lang->def('_COURSE_PRIZE'), 'edition_price', 'edition_price', 11, $course_edition["price"]) . $form->getTextfield($lang->def('_COURSE_ADVANCE'), 'edition_advance', 'edition_advance', 11, $course_edition['advance']) . $form->getTextfield($lang->def('_MIN_NUM_SUBSCRIBE'), 'min_num_subscribe', 'min_num_subscribe', 11, $course_edition["min_num_subscribe"]) . $form->getTextfield($lang->def('_MAX_NUM_SUBSCRIBE'), 'max_num_subscribe', 'max_num_subscribe', 11, $course_edition["max_num_subscribe"]) . $form->getCheckbox($lang->def('_ALLOW_OVERBOOKING'), 'allow_overbooking', 'allow_overbooking', 1, $course_edition["allow_overbooking"]) . $form->getCloseFieldset());
    $hours = array('-1' => '- -', '0' => '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23');
    $quarter = array('-1' => '- -', '00' => '00', '15' => '15', '30' => '30', '45' => '45');
    if ($course_edition['hour_begin'] != '-1') {
        $hb_sel = (int) substr($course_edition['hour_begin'], 0, 2);
        $qb_sel = substr($course_edition['hour_begin'], 3, 2);
    } else {
        $hb_sel = $qb_sel = '-1';
    }
    if ($course_edition['hour_end'] != '-1') {
        $he_sel = (int) substr($course_edition['hour_end'], 0, 2);
        $qe_sel = substr($course_edition['hour_end'], 3, 2);
    } else {
        $he_sel = $qe_sel = '-1';
    }
    $out->add($form->getOpenFieldset($lang->def('_COURSE_TIME_OPTION')) . $form->getDatefield($lang->def('_DATE_BEGIN'), 'course_edition_date_begin', 'course_edition_date_begin', $date_begin) . $form->getDatefield($lang->def('_DATE_END'), 'course_edition_date_end', 'course_edition_date_end', $date_end) . $form->getLineBox('<label for="hour_begin_hour">' . $lang->def('_HOUR_BEGIN') . '</label>', $form->getInputDropdown('dropdown_nw', 'hour_begin_hour', 'hour_begin[hour]', $hours, $hb_sel, '') . ' : ' . $form->getInputDropdown('dropdown_nw', 'hour_begin_quarter', 'hour_begin[quarter]', $quarter, $qb_sel, '')) . $form->getLineBox('<label for="hour_end_hour">' . $lang->def('_HOUR_END') . '</label>', $form->getInputDropdown('dropdown_nw', 'hour_end_hour', 'hour_end[hour]', $hours, $he_sel, '') . ' : ' . $form->getInputDropdown('dropdown_nw', 'hour_end_quarter', 'hour_end[quarter]', $quarter, $qe_sel, '')) . $form->getCloseFieldset());
    $out->add($form->getOpenFieldset($lang->def('_DOCUMENT_UPLOAD')) . $form->getExtendedFilefield($lang->def('_USER_MATERIAL'), 'course_edition_material', 'course_edition_material', $course_edition["img_material"]) . $form->getExtendedFilefield($lang->def('_OTHER_USER_MATERIAL'), 'course_edition_othermaterial', 'course_edition_othermaterial', $course_edition["img_othermaterial"]) . $form->getCloseFieldset() . $form->closeElementSpace());
    $out->add($form->openButtonSpace() . $form->getButton('course_edition_modify', 'course_edition_modify', $lang->def('_SAVE')) . $form->getButton('course_undo', 'course_undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm() . '</div>');
}
Example #23
0
 function modnotes()
 {
     checkPerm('view');
     list($title, $textof) = sql_fetch_row(sql_query("\r\n\tSELECT title, textof \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_notes \r\n\tWHERE  idNotes = '" . $_GET['idNotes'] . "'  AND owner ='" . getLogUserId() . "' AND idCourse='" . $_SESSION['idCourse'] . "'"));
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('notes', 'lms');
     $page_title = array('index.php?modname=notes&amp;op=notes' => $lang->def('_NOTES'), $lang->def('_MOD_NOTES'));
     $GLOBALS['page']->add(getTitleArea(array(), 'notes') . '<div class="std_block">' . getBackUi('index.php?modname=notes&amp;op=notes', $lang->def('_BACK')) . Form::openForm('formnotes', 'index.php?modname=notes&amp;op=upnotes') . Form::openElementSpace() . Form::getHidden('idNotes', 'idNotes', $_GET['idNotes']) . Form::getTextfield($lang->def('_TITLE'), 'title', 'title', 255, $title) . Form::getTextarea($lang->def('_TEXTOF'), 'description', 'description', $textof) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
 }
Example #24
0
<?php

Get::title(array('index.php?r=' . $base_link_course . '/show' => Lang::t('_COURSE', 'course'), 'index.php?r=' . $base_link_classroom . '/classroom&id_course=' . $model->getIdCourse() => Lang::t('_CLASSROOM', 'course'), Lang::t('_ADD', 'course')));
if (isset($err_avail)) {
    echo UIFeedback::error(Lang::t($err_avail, 'course'));
}
?>
<div class="std_block">

<?php 
echo Form::openForm('add_date', 'index.php?r=' . $base_link_classroom . '/addclassroom&amp;id_course=' . $model->getIdCourse()) . Form::getHidden('step', 'step', '2') . Form::openElementSpace() . Form::getTextfield(Lang::t('_CODE', 'course'), 'code', 'code', 255, isset($_POST['code']) ? $_POST['code'] : $course_info['code']) . Form::getTextfield(Lang::t('_NAME', 'course'), 'name', 'name', 255, isset($_POST['name']) ? $_POST['name'] : $course_info['name']) . Form::getTextarea(Lang::t('_DESCRIPTION', 'course'), 'description', 'description', isset($_POST['description']) ? stripslashes(stripslashes($_POST['description'])) : stripslashes($course_info['description'])) . Form::getTextfield(Lang::t('_MEDIUM_TIME', 'course'), 'medium_time', 'medium_time', 255, isset($_POST['medium_time']) ? $_POST['medium_time'] : $course_info['mediumTime']) . Form::getTextfield(Lang::t('_MAX_NUM_SUBSCRIBE', 'course'), 'max_par', 'max_par', 255, isset($_POST['max_par']) ? $_POST['max_par'] : '') . Form::getTextfield(Lang::t('_COURSE_PRIZE', 'course'), 'price', 'price', 255, isset($_POST['price']) ? $_POST['price'] : '') . Form::getDropdown(Lang::t('_STATUS', 'course'), 'status', 'status', $model->getStatusForDropdown(), isset($_POST['status']) ? $_POST['status'] : '') . Form::getDropdown(Lang::t('_FINAL_SCORE', 'course'), 'test', 'test', $model->getTestTypeForDropdown(), isset($_POST['test']) ? $_POST['test'] : '') . '<div class="form_line_l">' . '<p><label for="overbooking" class="floating">' . Lang::t('_ALLOW_OVERBOOKING', 'course') . '</label></p>' . Form::getInputCheckbox('overbooking', 'overbooking', 1, isset($_POST['overbooking']) && $_POST['overbooking'] == 1 ? true : false, false) . '</div>' . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_BEGIN', 'course'), 'sub_start_date', 'sub_start_date', isset($_POST['sub_start_date']) ? $_POST['sub_start_date'] === '00-00-0000' ? '' : $_POST['sub_start_date'] : '') . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_END', 'course'), 'sub_end_date', 'sub_end_date', isset($_POST['sub_end_date']) ? $_POST['sub_end_date'] === '00-00-0000' ? '' : $_POST['sub_end_date'] : '') . Form::getDatefield(Lang::t('_UNSUBSCRIBE_DATE_LIMIT', 'course'), 'unsubscribe_date_limit', 'unsubscribe_date_limit', isset($_POST['unsubscribe_date_limit']) ? $_POST['unsubscribe_date_limit'] === '00-00-0000' ? '' : $_POST['unsubscribe_date_limit'] : '') . '<div id="date_container">';
?>

<div id="calendar_container" class="form_line_l"></div>

<?php 
$date_string = '';
$start_mounth = '';
if (isset($_POST['date_selected']) && !empty($_POST['date_selected'])) {
    $array_day = explode(',', $_POST['date_selected']);
    $first = true;
    if (count($array_day) > 0) {
        for ($i = 0; $i < count($array_day); $i++) {
            if ($first) {
                $first = false;
                $start_mounth = (int) substr($array_day[$i], 5, 2) . '/' . substr($array_day[$i], 0, 4);
                $date_string .= (int) substr($array_day[$i], 5, 2) . '/' . (int) substr($array_day[$i], 8, 2) . '/' . substr($array_day[$i], 0, 4);
            } else {
                $date_string .= ',' . (int) substr($array_day[$i], 5, 2) . '/' . (int) substr($array_day[$i], 8, 2) . '/' . substr($array_day[$i], 0, 4);
            }
        }
Example #25
0
function searchUser(&$url)
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.form.php';
    require_once $GLOBALS['where_framework'] . '/lib/lib.myfriends.php';
    $lang =& DoceboLanguage::createInstance('myfriends', 'lms');
    $my_fr = new MyFriends(getLogUserId());
    $acl_man =& Docebo::user()->getAclManager();
    $GLOBALS['page']->add(getTitleArea(array($url->getUrl() => $lang->def('_MY_FRIENDS'), $lang->def('_SEARCH_USER')), 'myfriends') . '<div class="std_block">', 'content');
    if (isset($_POST['send'])) {
        if ($my_fr->addFriend($_POST['id_friend'], MF_WAITING, $_POST['request'])) {
            Util::jump_to($url->getUrl('result=ok_del'));
        }
        $GLOBALS['page']->add(getErrorUi($lang->def('_ERR_REMOVE_FRIEND')));
    } elseif (isset($_GET['id_friend'])) {
        $GLOBALS['page']->add(Form::openForm('send_request', $url->getUrl('op=searchuser')) . Form::getHidden('id_friend', 'id_friend', $_GET['id_friend']) . Form::openElementSpace() . Form::getTextarea($lang->def('_REQUEST_MESSAGE'), 'request', 'request') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('send', 'send', $lang->def('_SEND_REQUEST')) . Form::getButton('back_search', 'back_search', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
        return;
    }
    $GLOBALS['page']->add(Form::openForm('', $url->getUrl('op=searchuser')) . Form::getOpenFieldset($lang->def('_SEARCH_USER')) . Form::getTextfield($lang->def('_SEARCH_USERNAME'), 'username', 'username', 255, importVar('username', false, '')) . Form::openButtonSpace() . Form::getButton('search', 'search', $lang->def('_SEARCH')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::getCloseFieldset() . Form::closeForm(), 'content');
    if (isset($_POST['username'])) {
        $finded_user = $acl_man->getUser(false, $acl_man->absoluteId($_POST['username']));
        if ($finded_user === false) {
            $GLOBALS['page']->add($lang->def('_NO_USER_FINDED'), 'content');
        } else {
            require_once _base_ . '/lib/lib.user_profile.php';
            if (getLogUserId() != $finded_user[ACL_INFO_IDST]) {
                $GLOBALS['page']->add('<p class="confirm_friend">' . '<a href="' . $url->getUrl('op=searchuser&id_friend=' . $finded_user[ACL_INFO_IDST] . '') . '">' . $lang->def('_ADD_TO_MY_FIREND') . '</a>' . '</p>', 'content');
            }
            $profile = new UserProfile($finded_user[ACL_INFO_IDST]);
            $profile->init('profile', 'framework', 'modname=myfriends&op=searchuser', 'ap');
            $GLOBALS['page']->add($profile->getUserInfo(), 'content');
        }
    }
    $GLOBALS['page']->add('</div>', 'content');
}
Example #26
0
function reservationSendMail()
{
    checkPerm('view');
    $lang =& DoceboLanguage::createInstance('reservation');
    $mod_perm = checkPerm('mod', true);
    $id_course = $_SESSION['idCourse'];
    $id_event = importVar('id_event', true, 0);
    $out = $GLOBALS['page'];
    $out->setWorkingZone('content');
    $man_res = new Man_Reservation();
    $acl_man =& Docebo::user()->getAclManager();
    if (isset($_POST['send_mail'])) {
        $recipients = $man_res->getEventUserMail($id_event);
        $subject = importVar('mail_object', false, '[Nessun Oggetto]');
        $body = importVar('mail_body', false, '');
        $info_user = $acl_man->getUser(getLogUserId());
        $sender = $info_user[ACL_INFO_EMAIL];
        //sendMail($recipients, $subject, $body, $sender);
        require_once _base_ . '/lib/lib.mailer.php';
        $mailer = DoceboMailer::getInstance();
        $mailer->SendMail($sender, $recipients, Lang::t('_MAIL_OBJECT', 'register'), $body, array(MAIL_REPLYTO => $sender, MAIL_SENDER_ACLNAME => false));
        Util::jump_to('index.php?modname=reservation&op=reservation&active_tab=events');
    } else {
        require_once _base_ . '/lib/lib.form.php';
        $out->add(getTitleArea($lang->def('_RESERVATION_MAIL_SEND') . '<div class="std_block">', 'content'));
        $out->add(Form::openForm('form_event', 'index.php?modname=reservation&amp;op=send_mail') . Form::openElementSpace() . Form::getTextfield($lang->def('_SUBJECT'), 'mail_object', 'mail_object', 255) . Form::getTextarea($lang->def('_MAIL_BODY'), 'mail_body', 'mail_body') . Form::getHidden('id_event', 'id_event', $id_event) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('send_mail', 'send_mail', $lang->def('_SEND_MAIL')) . Form::getButton('undo_mail', 'undo_mail', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>');
    }
}
Example #27
0
<br />

<?php 
$title = array('index.php?r=' . $base_link_course . '/show' => Lang::t('_COURSE', 'course'), 'index.php?r=' . $base_link_edition . '/show&id_course=' . $model->getIdCourse() => Lang::t('_EDITIONS', 'course'), Lang::t('_ADD', 'course'));
echo getTitleArea($title);
?>

<div class="std_block">

<?php 
echo Form::openForm('add_edition_form', 'index.php?r=' . $base_link_edition . '/add&amp;id_course=' . $model->getIdCourse()) . Form::openElementSpace() . Form::getTextfield(Lang::t('_CODE', 'course'), 'code', 'code', 255, $course_info['code']) . Form::getTextfield(Lang::t('_NAME', 'course'), 'name', 'name', 255, $course_info['name']) . Form::getTextarea(Lang::t('_DESCRIPTION', 'course'), 'description', 'description', $course_info['description']) . Form::getDropdown(Lang::t('_STATUS', 'course'), 'status', 'status', $model->getStatusForDropdown()) . Form::getTextfield(Lang::t('_MAX_NUM_SUBSCRIBE', 'course'), 'max_par', 'max_par', 255) . Form::getTextfield(Lang::t('_MIN_NUM_SUBSCRIBE', 'course'), 'min_par', 'min_par', 255) . Form::getTextfield(Lang::t('_COURSE_PRIZE', 'course'), 'price', 'price', 255) . Form::getDatefield(Lang::t('_DATE_BEGIN', 'course'), 'date_begin', 'date_begin') . Form::getDatefield(Lang::t('_DATE_END', 'course'), 'date_end', 'date_end') . '<div class="form_line_l">' . '<p><label for="overbooking" class="floating">' . Lang::t('_ALLOW_OVERBOOKING', 'course') . '</label></p>' . Form::getInputCheckbox('overbooking', 'overbooking', 1, false, false) . '</div>' . '<div class="form_line_l">' . '<p><label for="overbooking" class="floating">' . Lang::t('_SUBSCRIPTION_OPEN', 'course') . '</label></p>' . Form::getInputCheckbox('can_subscribe', 'can_subscribe', 1, false, false) . '</div>' . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_BEGIN', 'course'), 'sub_date_begin', 'sub_date_begin') . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_END', 'course'), 'sub_date_end', 'sub_date_end') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('ins', 'ins', Lang::t('_SAVE', 'course')) . Form::getButton('undo', 'undo', Lang::t('_UNDO', 'course')) . Form::closeButtonSpace() . Form::closeForm();
?>

</div>
}
echo Form::openForm($_form_id, $_form_action);
echo Form::getDropdown(Lang::t('_CATEGORY', 'competences'), 'id_category', 'id_category', $competence_categories, isset($id_category) && (int) $id_category > 0 ? (int) $id_category : '0');
//edit name and description in all languages (in a TabView widget)
echo '<div id="competence_langs_tab" class="yui-navset">';
$_tabview_titles = '<ul class="yui-nav">';
$_tabview_contents = '<div class="yui-content">';
$_langs = Docebo::langManager()->getAllLanguages(true);
foreach ($_langs as $_lang_code => $_lang_data) {
    $_name = isset($competence_langs[$_lang_code]) ? $competence_langs[$_lang_code]['name'] : "";
    $_desc = isset($competence_langs[$_lang_code]) ? $competence_langs[$_lang_code]['description'] : "";
    //echo Form::getOpenFieldset($_lang_data['description']);
    $_tabview_titles .= '<li' . ($_lang_code == getLanguage() ? ' class="selected"' : '') . '>' . '<a href="#langs_tab_' . $_lang_code . '"><em>' . $_lang_code . ($_name == '' && isset($id_competence) ? ' (*)' : '') . '</em></a></li>';
    $_tabview_contents .= '<div id="langs_tab_' . $_lang_code . '">';
    $_tabview_contents .= Form::getTextfield(Lang::t('_NAME', 'standard'), 'name_' . $_lang_code, 'name[' . $_lang_code . ']', 255, $_name);
    $_tabview_contents .= Form::getTextarea(Lang::t('_DESCRIPTION', 'standard'), 'description_' . $_lang_code, 'description[' . $_lang_code . ']', $_desc);
    $_tabview_contents .= '</div>';
    //echo Form::getCloseFieldset();
}
//end for
$_tabview_titles .= '</ul>';
$_tabview_contents .= '</div>';
echo $_tabview_titles . $_tabview_contents;
echo '</div>';
echo '<script type="text/javascript">YAHOO.util.Event.onDOMReady(function() {' . ' var tabs = new YAHOO.widget.TabView("competence_langs_tab"); });</script>';
//if we are editing an existing competence, than print its id
if (isset($id_competence)) {
    echo Form::getHidden('id_competence', 'id_competence', $id_competence);
}
//if we are creating a new competence, than get the category id in which the competence should be created
//if (isset($id_category)) echo Form::getHidden('id_category', 'id_category', $id_category);
if (!$_is_editing) {
    echo Form::getHidden('id_location', 'id_location', (int) $id_location);
}
if ($_is_editing) {
    echo Form::getHidden('id_classroom', 'id_classroom', $info->idClassroom);
}
if ($_is_editing) {
    echo Form::getHidden('id_location', 'id_location', $info->location_id);
}
echo Form::getTextfield(Lang::t('_BUILDING_ROOM', 'classroom'), 'room', 'room', 255, $_is_editing ? $info->room : "");
echo Form::getTextfield(Lang::t('_CAPACITY', 'classroom'), 'capacity', 'capacity', 255, $_is_editing ? $info->capacity : "");
echo Form::getTextfield(Lang::t('_RESPONSABLE', 'classroom'), 'responsable', 'responsable', 255, $_is_editing ? $info->responsable : "");
echo Form::getTextfield(Lang::t('_STREET', 'classroom'), 'street', 'street', 255, $_is_editing ? $info->street : "");
echo Form::getTextfield(Lang::t('_CITY', 'classroom'), 'city', 'city', 255, $_is_editing ? $info->city : "");
echo Form::getTextfield(Lang::t('_STATE', 'classroom'), 'state', 'state', 255, $_is_editing ? $info->state : "");
echo Form::getTextfield(Lang::t('_ZIP_CODE', 'classroom'), 'zip_code', 'zip_code', 255, $_is_editing ? $info->zip_code : "");
echo Form::getTextfield(Lang::t('_PHONE', 'classroom'), 'phone', 'phone', 255, $_is_editing ? $info->phone : "");
echo Form::getTextfield(Lang::t('_FAX', 'classroom'), 'fax', 'fax', 255, $_is_editing ? $info->fax : "");
echo Form::getTextarea(Lang::t('_DISPOSITION', 'classroom'), 'disposition', 'disposition', $_is_editing ? $info->disposition : "");
echo Form::getTextarea(Lang::t('_INSTRUMENT', 'classroom'), 'instrument', 'instrument', $_is_editing ? $info->instrument : "");
echo Form::getTextarea(Lang::t('_AVAILABLE_INSTRUMENT', 'classroom'), 'available_instrument', 'available_instrument', $_is_editing ? $info->available_instrument : "");
echo Form::getTextarea(Lang::t('_NOTES', 'classroom'), 'note', 'note', $_is_editing ? $info->note : "");
echo Form::openButtonSpace();
echo $_is_editing ? Form::getButton('save', 'save', Lang::t('_SAVE', 'classroom')) : Form::getButton('save', 'save', Lang::t('_SAVE', 'classroom'));
echo Form::getButton('undo', 'undo', Lang::t('_UNDO', 'classroom'));
echo Form::closeButtonSpace();
echo Form::closeForm();
?>
</div>

Example #30
0
function modfiles(&$url)
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.form.php';
    $file_man = new MyFile(getLogUserId());
    $lang =& DoceboLanguage::createInstance('myfiles');
    $area = importVar('working_area', false, $file_man->getDefaultArea());
    $id_file = importVar('id_file', true, 0);
    $title = '';
    $description = '';
    $file_policy = MF_POLICY_FREE;
    if ($id_file != 0) {
        $f_info = $file_man->getFileInfo($id_file);
        $title = $f_info[MYFILE_TITLE];
        $description = $f_info[MYFILE_DESCRIPTION];
        $file_policy = $f_info[MYFILE_POLICY];
    }
    $arr_policy = array(MF_POLICY_FREE => $lang->def('_MF_POLICY_FREE'), MF_POLICY_TEACHER => $lang->def('_MF_POLICY_TEACHER'), MF_POLICY_FRIENDS => $lang->def('_MF_POLICY_FRIENDS'), MF_POLICY_TEACHER_AND_FRIENDS => $lang->def('_MF_POLICY_TEACHER_AND_FRIENDS'), MF_POLICY_NOONE => $lang->def('_MF_POLICY_NOONE'));
    $title_page = array($url->getUrl('op=myfiles') => $lang->def('_MYFILE'), $lang->def('_ADD_' . $area));
    $GLOBALS['page']->add(getTitleArea($title_page, 'myfile') . '<div class="std_block">' . getBackUi($url->getUrl('op=myfiles'), $lang->def('_BACK')) . Form::openForm('add_file', $url->getUrl('op=savefiles'), false, false, 'multipart/form-data') . Form::openElementSpace() . Form::getHidden('id_file', 'id_file', $id_file) . Form::getHidden('working_area', 'working_area', $area) . Form::getTextfield($lang->def('_TITLE'), 'title', 'title', 255, $title) . Form::getFilefield($lang->def('_UPLOAD'), 'uploaded_file', 'uploaded_file') . Form::getDropdown($lang->def('_FILE_POLICY'), 'file_policy', 'file_policy', $arr_policy, $file_policy) . Form::getTextarea($lang->def('_DESCRIPTION'), 'description', 'description', $description) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', $id_file == 0 ? $lang->def('_INSERT') : $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
}