本文整理汇总了PHP中Form::getHidden方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::getHidden方法的具体用法?PHP Form::getHidden怎么用?PHP Form::getHidden使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form
的用法示例。
在下文中一共展示了Form::getHidden方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAddEditForm
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;
}
示例2: moditem
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('&', '&', $object_item->back_url) . '&mod_result=0', $lang->def('_BACK')) . Form::openForm('itemform', 'index.php?modname=item&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');
}
示例3: modpoll
function modpoll()
{
checkPerm('view', false, 'storage');
$lang =& DoceboLanguage::createInstance('poll');
require_once _base_ . '/lib/lib.form.php';
$id_poll = importVar('id_poll', true, 0);
$back_url = urldecode(importVar('back_url'));
$url_encode = htmlentities(urlencode($back_url));
list($poll_title, $textof) = sql_fetch_row(sql_query("\r\n\tSELECT title, description\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_poll\r\n\tWHERE id_poll = '" . $id_poll . "'"));
$GLOBALS['page']->add(getTitleArea($lang->def('_POLL_SECTION'), 'poll') . '<div class="std_block">' . getBackUi('index.php?modname=poll&op=modpollgui&id_poll=' . $id_poll . '&back_url=' . $url_encode, $lang->def('_BACK')) . Form::OpenForm('addpoll_form', 'index.php?modname=poll&op=uppoll') . Form::openElementSpace() . Form::getHidden('id_poll', 'id_poll', $id_poll) . Form::getHidden('back_url', 'back_url', $url_encode) . Form::getTextfield($lang->def('_TITLE'), 'title', 'title', '255', $poll_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');
}
示例4: edit
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&op=edit&type_quest=' . $this->getQuestionType() . '&id_quest=' . $this->id . '&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('&', '&', $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&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');
}
示例5: config
function config()
{
checkPerm('view');
require_once _base_ . '/lib/lib.tab.php';
require_once _base_ . '/lib/lib.form.php';
require_once _adm_ . '/class/class.conf.php';
$lang =& DoceboLanguage::createInstance('configuration', 'framework');
$active_tab = importVar('active_tab', false, 1);
//instance class-------------------------------------------
$conf = new Config_Framework();
$groups = $conf->getRegroupUnit();
cout(getTitleArea($lang->def('_CONFIGURATION')) . '<div class="std_block">');
//save page if require
if (isset($_POST['save_config'])) {
if ($conf->saveElement($active_tab)) {
cout(getResultUi($lang->def('_OPERATION_SUCCESSFUL')));
} else {
cout(getErrorUi($lang->def('_ERROR_IN_SAVE')));
}
}
cout('<div id="global_conf" class="yui-navset">' . '<ul class="yui-nav">');
while (list($id, $name) = each($groups)) {
// print the tab list
cout('<li' . ($id == $active_tab ? ' class="selected"' : '') . '><a href="#tab_g_' . $id . '"><em>' . $name['name'] . '</em></a></li>');
}
reset($groups);
cout('</ul>' . '<div class="yui-content">');
while (list($id, $name) = each($groups)) {
// print the tab content
cout('<div id="tab_g_' . $id . '">' . '<h2>' . $name['name'] . '</h2>' . '<p style="padding:4px">' . $name['descr'] . '</p>' . Form::openForm('conf_option_' . $id, 'index.php?modname=configuration&op=config') . Form::openElementSpace() . Form::getHidden('active_tab_' . $id, 'active_tab', $id));
switch ($id) {
case SMS_GROUP:
cout(show_sms_panel($lang) . '<br />');
break;
default:
cout('<br />');
}
cout('' . $conf->getPageWithElement($id) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save_config_' . $id, 'save_config', $lang->def('_SAVE')) . Form::getButton('undo_' . $id, 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::CloseForm() . '<br />' . '</div>');
}
cout('<script type="text/javascript">
var targets = YAHOO.util.Selector.query("span[id^=tt_target]");
new YAHOO.widget.Tooltip("tooltip_info",
{ context:targets,
effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.20}
});
</script>', 'scripts');
reset($groups);
cout('</div>' . '<div style="clear:left"> </div>' . '</div>' . '</div>');
cout('<script type="text/javascript">' . "\tnew YAHOO.widget.TabView('global_conf', {orientation:'left'});" . '</script>', 'scripts');
}
示例6: newsletter
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&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");
}
示例7: additem
function additem($object_item)
{
//checkPerm( 'view', FALSE, 'storage' );
$lang =& DoceboLanguage::createInstance('scorm', 'lms');
require_once _base_ . '/lib/lib.form.php';
$form = new Form();
//area title
$GLOBALS['page']->add(getTitleArea($lang->getLangText('_SCORMIMGSECTION'), 'scorm', $lang->getLangText('_SCORMSECTIONNAME')));
$GLOBALS['page']->add('<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&', $object_item->back_url) . '&create_result=0', $lang->getLangText('_BACK_TOLIST')));
$GLOBALS['page']->add(Form::getFormHeader($lang->def('_SCORM_ADD_FORM')));
$GLOBALS['page']->add($form->openForm("scormform", "index.php?modname=scorm&op=insitem", false, false, 'multipart/form-data'));
$GLOBALS['page']->add($form->openElementSpace());
$GLOBALS['page']->add($form->getHidden("back_url", "back_url", htmlentities(urlencode($object_item->back_url))));
$GLOBALS['page']->add($form->getFilefield($lang->getLangText('_CONTENTPACKAGE'), "attach", "attach"));
$GLOBALS['page']->add($form->getCheckbox($lang->getLangText('_SCORMIMPORTRESOURCES'), "lesson_resources", "lesson_resources", "import"));
$GLOBALS['page']->add($form->closeElementSpace());
$GLOBALS['page']->add($form->openButtonSpace());
$GLOBALS['page']->add($form->getButton("scorm_add_submit", "scorm_add_submit", $lang->getLangText('_SCORMLOAD')));
$GLOBALS['page']->add($form->closeButtonSpace());
$GLOBALS['page']->add($form->closeForm() . '</div>');
}
示例8: modpage
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('&', '&', $object_page->back_url) . '&mod_result=0', $lang->def('_BACK')) . Form::openForm('pageform', 'index.php?modname=htmlpage&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');
}
示例9: getBackUi
Get::title(array('index.php?r=alms/location/show' => Lang::t('_LOCATION', 'classroom'), 'index.php?r=alms/location/show_classroom&id_location=' . ($_is_editing ? $info->location_id : $id_location) => Lang::t('_CLASSROOM', 'classroom'), Lang::t($_is_editing ? '_MOD' : '_ADD', 'standard')));
?>
<div class="std_block">
<?php
echo getBackUi('index.php?r=alms/location/show_classroom&id_location=' . ($_is_editing ? $info->location_id : $id_location), Lang::t('_BACK'));
echo Form::openForm('classroom_form', $_is_editing ? 'index.php?r=alms/location/saveclassroom' : 'index.php?r=alms/location/insertclassroom');
echo Form::getTextfield(Lang::t('_NAME', 'classroom'), 'name', 'name', 255, $_is_editing ? $info->name : "");
echo Form::getTextarea(Lang::t('_DESCRIPTION', 'classroom'), 'description', 'description', $_is_editing ? $info->description : "");
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();
示例10: mycertificate
function mycertificate(&$url)
{
checkPerm('view');
require_once _lms_ . '/lib/lib.course.php';
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('profile', 'framework');
$lang =& DoceboLanguage::createInstance('course', 'lms');
$lang =& DoceboLanguage::createInstance('certificate', 'lms');
$admin_level = Docebo::user()->getUserLevelId();
$show_preview = true;
//($admin_level == ADMIN_GROUP_ADMIN || $admin_level == ADMIN_GROUP_GODADMIN);
$title = $lang->def('_MY_CERTIFICATE', 'certificate');
$html = getTitleArea($title, 'mycertificate') . '<div class="std_block">';
//--- draw time periods dropdown ---------------------------------------------
$period_start = '';
$period_end = '';
//extract checking period
$p_model = new TimeperiodsAlms();
$year = date("Y");
$p_list = array("0" => $lang->def('_ALL'));
$p_selected = Get::req('selected_period', DOTY_INT, 0);
$p_data = $p_model->getTimePeriods('', true);
if (count($p_data) > 0) {
foreach ($p_data as $obj) {
$p_list[$obj->id_period] = Format::date($obj->start_date, 'date') . ' - ' . Format::date($obj->end_date, 'date');
if ($p_selected == $obj->id_period) {
$period_start = $obj->start_date;
$period_end = $obj->end_date;
}
}
}
if (!array_key_exists($p_selected, $p_list)) {
$p_selected = 0;
$period_start = '';
$period_end = '';
}
//date dropdown
$onchange = ' onchange="javascript:this.form.submit();"';
$html_filter_cert = '' . Form::openForm('selected_period_form_cert', $url->getUrl()) . Form::openElementSpace() . Form::getDropdown(Lang::t('_TIME_PERIODS', 'menu'), 'selected_period_cert', 'selected_period', $p_list, $p_selected, '', '', $onchange) . Form::closeElementSpace() . Form::getHidden('current_tab_cert', 'current_tab', Get::req('current_tab', DOTY_STRING, 'cert')) . Form::getHidden('is_filtering_cert', 'is_filtering_cert', 1) . Form::closeForm();
$html_filter_meta = '' . Form::openForm('selected_period_form_meta', $url->getUrl()) . Form::openElementSpace() . Form::getDropdown(Lang::t('_TIME_PERIODS', 'menu'), 'selected_period_meta', 'selected_period', $p_list, $p_selected, '', '', $onchange) . Form::closeElementSpace() . Form::getHidden('current_tab_meta', 'current_tab', Get::req('current_tab', DOTY_STRING, 'meta')) . Form::getHidden('is_filtering_meta', 'is_filtering_meta', 1) . Form::closeForm();
//----------------------------------------------------------------------------
$cert = new Certificate();
/*
* Print certificates tables, subdivided by year and course type
*/
$html_cert = '';
$tb_cert = new Table(0);
$cont_h = array($lang->def('_YEAR', 'standard'), $lang->def('_COURSE_CODE', 'course'), $lang->def('_COURSE', 'course'), $lang->def('_CERTIFICATE_NAME', 'course'), $lang->def('_DATE_END', 'course'));
//if ($show_preview) $cont_h[] = '<img src="'.getPathImage('lms').'certificate/preview.gif" alt="'.$lang->def('_PREVIEW').'" />';
//$cont_h[] = '<img src="'.getPathImage('lms').'certificate/certificate.gif" alt="'.$lang->def('_ALT_TAKE_A_COPY').'" />';
if ($show_preview) {
$cont_h[] = '<span class="ico-sprite subs_view"><span>' . $lang->def('_PREVIEW') . '"</span></span>';
}
$cont_h[] = '<span class="ico-sprite subs_pdf"><span>' . $lang->def('_ALT_TAKE_A_COPY') . '</span></span>';
$type_h = array('img-cell', '', '', 'align-center', 'align-center', 'img-cell', 'img-cell');
if ($show_preview) {
$type_h[] = 'nowarp';
}
$type_h[] = 'nowarp';
$tb_cert->setColsStyle($type_h);
$tb_cert->addHead($cont_h);
$available_cert = $cert->certificateForCourses(false, false);
$released = $cert->certificateReleased(Docebo::user()->getIdST());
$query_courses = "" . " SELECT c.idCourse, c.code, c.name, u.status AS user_status, c.course_type, c.permCloseLO " . " FROM %lms_course AS c JOIN %lms_courseuser AS u ON (c.idCourse = u.idCourse) " . " WHERE u.idUser = '" . Docebo::user()->getIdST() . "' " . ($period_start != '' ? " AND u.date_complete >= '" . $period_start . "' " : "") . ($period_end != '' ? " AND u.date_complete <= '" . $period_end . "' " : "") . " ORDER BY u.date_complete DESC, u.status DESC ";
$course_list = sql_query($query_courses);
$arr_courses = array();
$arr_courses_ids = array();
while ($obj = sql_fetch_object($course_list)) {
$arr_courses[$obj->course_type][] = array($obj->idCourse, $obj->code, $obj->name, $obj->user_status, $obj->permCloseLO);
$arr_courses_ids[] = $obj->idCourse;
}
$arr_course_types = getCourseTypes();
$table_displayed = false;
//extract certificates details and availability by courses ids
$arr_courses_ids = array_unique($arr_courses_ids);
$arr_certificates_availability = array();
$arr_certificates_details = array();
if (count($arr_courses_ids) > 0) {
$query = "SELECT id_certificate, id_course, available_for_status " . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_course" . " WHERE id_course IN (" . implode(",", $arr_courses_ids) . ")";
//." WHERE id_certificate = '".$id_cert."'"
//." AND id_course IN (".implode(",", $arr_courses_ids).")";
$res = sql_query($query);
while (list($id_certificate, $id_course, $available_for_status) = sql_fetch_row($res)) {
$arr_certificates_availability[$id_course][$id_certificate] = $available_for_status;
}
$cont = array();
$query = "SELECT idCourse, date_inscr, date_first_access, date_complete, status" . " FROM %lms_courseuser WHERE idUser = '" . Docebo::user()->getIdST() . "'" . " AND idCourse IN (" . implode(",", $arr_courses_ids) . ") " . ($period_start != '' ? " AND date_complete >= '" . $period_start . "' " : "") . ($period_end != '' ? " AND date_complete <= '" . $period_end . "' " : "");
$res = sql_query($query);
while (list($id_course, $date_inscr, $date_begin, $date_end, $status) = sql_fetch_row($res)) {
$arr_certificate_details[$id_course] = array($date_inscr, $date_begin, $date_end, $status);
}
}
//order arr_courses by key
ksort($arr_courses);
$years = array();
foreach ($arr_courses as $course_type => $course_data) {
if (in_array($course_type, array_keys($arr_course_types))) {
//$html .= '';
$tb = new Table(0);
$tb->setColsStyle($type_h);
//.........这里部分代码省略.........
示例11: array
<?php
$title = array('index.php?r=' . $this->link_course . '/show' => Lang::t('_COURSE', 'course'), Lang::t('_MULTIPLE_SUBSCRIPTION', 'course'));
echo getTitleArea($title) . '<div class="std_block">' . Form::openForm('course_selection_form', 'index.php?r=' . $this->link . '/multiplesubscription') . Form::getHidden('id_cat', 'id_cat', $id_cat) . Form::getHidden('step', 'step', '2') . Form::getHidden('user_selection', 'user_selection', $user_selection) . $course_selector->loadCourseSelector(true) . Form::openButtonSpace() . Form::getButton('back', 'back', Lang::t('_PREV', 'course')) . Form::getButton('next', 'next', Lang::t('_NEXT', 'course')) . Form::getButton('undo', 'undo', Lang::t('_UNDO', 'standard')) . Form::closeButtonSpace() . Form::closeForm() . '</div>';
示例12: searchUser
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');
}
示例13: create_report_name
function create_report_name()
{
checkPerm('mod');
require_once $GLOBALS['where_lms'] . '/admin/modules/report/class.report.php';
//reportbox class
require_once $GLOBALS['where_lms'] . '/lib/lib.report.php';
require_once _base_ . '/lib/lib.form.php';
load_categories();
$lang =& DoceboLanguage::createInstance('report');
$step_index = 0;
//$GLOBALS['page']->add( get_page_title($step_index) );
$_SESSION['report_tempdata'] = array();
$page_title = getTitleArea(array('index.php?modname=public_report_admin&op=reportlist' => $lang->def('_REPORT'), $lang->def('_NEW')), 'report');
$GLOBALS['page']->add($page_title . '<div class="std_block">', 'content');
$error = Get::req('err', DOTY_STRING, false);
switch ($error) {
case 'noname':
$GLOBALS['page']->add(getErrorUi($lang->def('_REPORT_NONAME')));
break;
}
$temp = array();
foreach ($GLOBALS['report_categories'] as $key => $value) {
$temp[$key] = $lang->def($value);
}
$GLOBALS['page']->add(Form::openForm('repcat_form', 'index.php?modname=public_report_admin&op=create_rows') . Form::getHidden('set_category', 'set_category', 1) . Form::getTextField($lang->def('_NAME'), 'report_name', 'report_name', '200') . Form::getDropDown($lang->def('_SELECT_REPORT_CATEGORY'), '', 'id_report', $temp) . Form::openButtonSpace() . Form::getButton('', 'cat_forward', $lang->def('_NEXT'), false) . Form::getButton('', 'cat_undo', $lang->def('_UNDO'), false) . Form::closeButtonSpace() . Form::closeForm(), 'content');
/*$lang->def('_REPORT_SCHEDMAN');$lang->def('_REPORT_SCHEDMAN_DESC');*/
$GLOBALS['page']->add('</div>', 'content');
}
示例14: while
<div class="std_block">
<div id="global_conf" class="yui-navset">
<ul class="yui-nav">
<?php
while (list($id, $canonical_name) = each($regroup)) {
echo '<li' . ($id == $active_tab ? ' class="selected"' : '') . '>' . '<a href="#tab_g_' . $id . '">' . '<em>' . Lang::t('_' . strtoupper($canonical_name), 'configuration') . '</em>' . '</a>' . '</li>';
}
reset($regroup);
?>
</ul>
<div class="yui-content">
<?php
while (list($id, $canonical_name) = each($regroup)) {
// print the tab content
echo '<div id="tab_g_' . $id . '">' . '<h2>' . Lang::t('_' . strtoupper($canonical_name), 'configuration') . '</h2>' . Form::openForm('conf_option_' . $id, 'index.php?r=adm/setting/save') . Form::openElementSpace() . Form::getHidden('active_tab_' . $id, 'active_tab', $id);
switch ($id) {
case SMS_GROUP:
$this->render('sms_group', array());
default:
echo '<br />';
}
$model->printPageWithElement($id);
echo Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save_config_' . $id, 'save_config', Lang::t('_SAVE', 'configuration')) . Form::getButton('undo_' . $id, 'undo', Lang::t('_UNDO', 'configuration')) . Form::closeButtonSpace() . Form::CloseForm() . '<br />' . '</div>';
}
?>
</div>
<div class="nofloat"> </div>
</div>
</div>
<script type="text/javascript">
示例15: edit
/**
* this function manage a field
*
* @param string $back indicates the return url
* @return nothing
*
* @access public
*/
function edit($back)
{
$back_coded = htmlentities(urlencode($back));
$array_lang = array();
$std_lang =& DoceboLanguage::createInstance('standard');
$lang =& DoceboLanguage::createInstance('field');
$array_lang = Docebo::langManager()->getAllLangCode();
$out =& $GLOBALS['page'];
if (isset($_POST['undo'])) {
//undo action
Util::jump_to($back . '&result=undo');
}
if (isset($_POST['save_field_' . $this->getFieldType()])) {
//insert mandatory translation
$mand_lang = getLanguage();
$show_on = '';
if (isset($_POST['show_on_platform'])) {
while (list($code, ) = each($_POST['show_on_platform'])) {
$show_on .= $code . ',';
}
}
//control if all is ok
if (!isset($_POST['new_freetext'][$mand_lang])) {
$out->add(getErrorUi($lang->def('_ERR_MUST_DEF_MANADATORY_TRANSLATION')) . getBackUi($this->getUrl() . '&type_field=' . $this->getFieldType() . '&back=' . $back_coded, $std_lang->def('_BACK')), 'content');
return;
}
if ($_POST['new_freetext'][$mand_lang] == $lang->def('_FIELD_NAME') || trim($_POST['new_freetext'][$mand_lang]) == '') {
$out->add(getErrorUi($lang->def('_ERR_MUST_DEF_MANADATORY_TRANSLATION')) . getBackUi($this->getUrl() . '&type_field=' . $this->getFieldType() . '&back=' . $back_coded, $std_lang->def('_BACK')), 'content');
return;
}
$existsing_translation = array();
$re_trans = sql_query("\r\n\t\t\tSELECT lang_code\r\n\t\t\tFROM " . $this->_getMainTable() . "\r\n\t\t\tWHERE id_common = '" . $this->id_common . "'");
while (list($l_code) = sql_fetch_row($re_trans)) {
$existsing_translation[$l_code] = 1;
}
$use_multilang = isset($_POST['use_multi_lang']) ? 1 : 0;
$re = true;
//insert other field
foreach ($_POST['new_freetext'] as $lang_code => $translation) {
if (isset($existsing_translation[$lang_code])) {
if (!sql_query("\r\n\t\t\t\t\tUPDATE " . $this->_getMainTable() . "\r\n\t\t\t\t\tSET translation = '" . $translation . "',\r\n\t\t\t\t\t\tshow_on_platform = '" . $show_on . "',\r\n\t\t\t\t\t\tuse_multilang = '" . $use_multilang . "'\r\n\t\t\t\t\tWHERE id_common = '" . (int) $this->id_common . "' AND lang_code = '" . $lang_code . "'")) {
$re = false;
}
} else {
if (!sql_query("\r\n\t\t\t\t\tINSERT INTO " . $this->_getMainTable() . "\r\n\t\t\t\t\t(type_field, id_common, lang_code, translation, show_on_platform, use_multilang) VALUES\r\n\t\t\t\t\t('" . $this->getFieldType() . "', '" . (int) $this->id_common . "', '" . $lang_code . "', '" . $translation . "', '" . $show_on . "', '" . $use_multilang . "') ")) {
$re = false;
}
}
}
Util::jump_to($back . '&result=' . ($re ? 'success' : 'fail'));
}
//load value form database
$re_trans = sql_query("\r\n\t\tSELECT lang_code, translation, show_on_platform, use_multilang\r\n\t\tFROM " . $this->_getMainTable() . "\r\n\t\tWHERE id_common = '" . $this->id_common . "'");
while (list($l_code, $trans, $show_on, $db_use_multilang) = sql_fetch_row($re_trans)) {
$translation[$l_code] = $trans;
if (!isset($show_on_platform)) {
$show_on_platform = array_flip(explode(',', $show_on));
}
if (!isset($use_multilang)) {
$use_multilang = $db_use_multilang;
}
}
require_once _base_ . '/lib/lib.form.php';
$form = new Form();
$out->setWorkingZone('content');
$out->add('<div class="std_block">');
$out->add($form->openForm('create_' . $this->getFieldType(), $this->getUrl()) . $form->openElementSpace() . $form->getHidden('type_field', 'type_field', $this->getFieldType()) . $form->getHidden('id_common', 'id_common', $this->id_common) . $form->getHidden('back', 'back', $back_coded));
$mand_lang = getLanguage();
foreach ($array_lang as $k => $lang_code) {
$out->add($form->getTextfield(($mand_lang == $lang_code ? '<span class="mandatory">*</span>' : '') . $lang_code, 'new_freetext_' . $lang_code, 'new_freetext[' . $lang_code . ']', 255, isset($translation[$lang_code]) ? $translation[$lang_code] : '', $lang_code . ' ' . $lang->def('_FIELD_NAME')));
}
$GLOBALS['page']->add($this->getMultiLangCheck($use_multilang), 'content');
$GLOBALS['page']->add($this->getShowOnPlatformFieldset($show_on_platform), 'content');
$out->add($form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('save_field', 'save_field_' . $this->getFieldType(), $std_lang->def('_SAVE', 'standard')) . $form->getButton('undo', 'undo', $std_lang->def('_UNDO', 'standard')) . $form->closeButtonSpace() . $form->closeForm());
$out->add('</div>');
}