function getAttachedFile($ext = false, $code = false) { $html = ''; require_once $GLOBALS['where_framework'] . '/lib/lib.myfiles.php'; require_once _base_ . '/lib/lib.table.php'; $lang =& DoceboLanguage::createInstance('eportfolio'); $file_man = new MyFile($this->id_user); $files = $this->man_epf->getPresentationAttach($this->id_presentation, $this->id_user); if (!count($files)) { return $html; } $files_info = $file_man->getFilteredFileList($files); // print presentation ------------------------------------------------------------- $tb = new Table(0, '', $lang->def('_SUMMARY_FILES')); $tb->setTableStyle('epf_files'); $tb->setColsStyle(array('')); $tb->addHead(array($lang->def('_NAME'))); while ($row = sql_fetch_row($files_info)) { if ($ext) { $link = 'index.php?modname=eportfolio&type=ext&op=downloadfile&id_presentation=' . $this->id_presentation . '&id_portfolio=' . $this->id_portfolio . '&id_user='******'&id_file=' . $row[MYFILE_ID_FILE] . '&code=' . $code . '&no_redirect=1'; } else { $link = 'index.php?modname=eportfolio&op=downloadfile&id_portfolio=' . $this->id_portfolio . '&id_user='******'&id_file=' . $row[MYFILE_ID_FILE]; } $cont = array('<a href="' . $link . '">' . $row[MYFILE_TITLE] . '</a>'); $tb->addBody($cont); } $html .= $tb->getTable(); return $html; }
function getCourseEditionTable($course_id) { $res = ""; require_once _base_ . '/lib/lib.table.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.course.php'; $lang_c =& DoceboLanguage::createInstance('catalogue'); $lang =& DoceboLanguage::createInstance('course'); /* $qtxt ="SELECT name FROM ".$GLOBALS["prefix_lms"]."_course "; $qtxt.="WHERE idCourse = '".(int)$course_id."'"; list($course_name)=sql_fetch_row(sql_query($qtxt)); */ $man_course = new Man_Course(); $course = $man_course->getCourseInfo($course_id); $course_name = $course["name"]; $subs_lang = array(0 => $lang->def('_COURSE_S_GODADMIN'), 1 => $lang->def('_COURSE_S_MODERATE'), 2 => $lang->def('_COURSE_S_FREE'), 3 => $lang->def('_COURSE_S_SECURITY_CODE')); $tab = new Table(0, $lang->def('_EDITIONS') . ": " . $course_name, $lang->def('_EDITIONS')); $tab->setTableStyle('edition_block'); $cont_h[] = $lang->def('_CODE'); $type_h[] = 'code_course'; $cont_h[] = $lang->def('_COURSE'); $type_h[] = ''; $cont_h[] = $lang->def('_SUBSCRIBE_METHOD'); $type_h[] = 'image nowrap'; $cont_h[] = $lang->def('_ENROL_COUNT'); $type_h[] = 'image nowrap'; $cont_h[] = $lang->def('_CREATION_DATE'); $type_h[] = 'image nowrap'; $cont_h[] = $lang->def('_SUBSCRIPTION', 'course'); $type_h[] = 'image nowrap'; $tab->setColsStyle($type_h); $tab->addHead($cont_h); $qtxt = "SELECT t1.*, COUNT(t2.idUser) as enrolled "; $qtxt .= "FROM " . $GLOBALS["prefix_lms"] . "_course_edition as t1 "; $qtxt .= "\tLEFT JOIN " . $GLOBALS['prefix_lms'] . "_courseuser AS t2 ON ( t1.idCourseEdition = t2.edition_id ) "; $qtxt .= "WHERE t1.idCourse='" . (int) $course_id . "' "; $qtxt .= "\tAND t1.status <> '" . CST_PREPARATION . "' "; $qtxt .= "GROUP BY t1.idCourseEdition "; $qtxt .= "ORDER BY t1.date_begin "; //$res.=$qtxt; $q = sql_query($qtxt); if ($q && mysql_num_rows($q) > 0) { while ($row = mysql_fetch_assoc($q)) { $cont = array(); $cont[] = $row["code"]; $edition_id = $row["idCourseEdition"]; $url = "index.php?modname=coursecatalogue&op=editiondetails&edition_id=" . $edition_id; $url .= "&course_id=" . $course_id; $cont[] = '<a href="' . $url . '">' . $row["name"] . "</a>\n"; $cont[] = $subs_lang[$course["subscribe_method"]]; $cont[] = $row["enrolled"]; $cont[] = createDateDistance($course["create_date"], "coursecatalogue"); $cont[] = getSubscribeActionLink($course_id, $course, $lang, $edition_id); $tab->addBody($cont); } $res .= $tab->getTable(); } else { $res = FALSE; } return $res; }
function showCatItems($cat_id, $vis_item) { $res = ""; require_once _base_ . '/lib/lib.table.php'; $table_caption = $this->lang->def("_TABLE_FAQ_CAP"); $table_summary = $this->lang->def("_TABLE_FAQ_SUM"); $um =& UrlManager::getInstance(); $tab = new Table($vis_item, $table_caption, $table_summary); if ($this->getTableStyle() !== FALSE) { $tab->setTableStyle($this->getTableStyle()); } $head = array($this->lang->def("_TITLE")); $img = "<img src=\"" . getPathImage('fw') . "standard/down.png\" alt=\"" . $this->lang->def("_MOVE_DOWN") . "\" "; $img .= "title=\"" . $this->lang->def("_MOVE_DOWN") . "\" />"; $head[] = $img; $img = "<img src=\"" . getPathImage('fw') . "standard/up.png\" alt=\"" . $this->lang->def("_MOVE_UP") . "\" "; $img .= "title=\"" . $this->lang->def("_MOVE_UP") . "\" />"; $head[] = $img; $img = "<img src=\"" . getPathImage('fw') . "standard/edit.png\" alt=\"" . $this->lang->def("_MOD") . "\" "; $img .= "title=\"" . $this->lang->def("_MOD") . "\" />"; $head[] = $img; $img = "<img src=\"" . getPathImage('fw') . "standard/delete.png\" alt=\"" . $this->lang->def("_DEL") . "\" "; $img .= "title=\"" . $this->lang->def("_DEL") . "\" />"; $head[] = $img; $head_type = array("", "image", "image", "image", "image"); $tab->setColsStyle($head_type); $tab->addHead($head); $tab->initNavBar('ini', 'link'); $tab->setLink($um->getUrl()); $ini = $tab->getSelectedElement(); $data_info = $this->wikiManager->getCategoryItems($cat_id, $ini, $vis_item); $data_arr = $data_info["data_arr"]; $db_tot = $data_info["data_tot"]; $tot = count($data_arr); for ($i = 0; $i < $tot; $i++) { $id = $data_arr[$i]["faq_id"]; $rowcnt = array(); $rowcnt[] = $data_arr[$i]["title"]; if ($ini + $i < $db_tot - 1) { $img = "<img src=\"" . getPathImage('fw') . "standard/down.png\" alt=\"" . $this->lang->def("_MOVE_DOWN") . "\" "; $img .= "title=\"" . $this->lang->def("_MOVE_DOWN") . "\" />"; $url = $um->getUrl("op=movefaqdown&catid=" . $cat_id . "&faqid=" . $id); $rowcnt[] = "<a href=\"" . $url . "\">" . $img . "</a>\n"; } else { $rowcnt[] = " "; } if ($ini + $i > 0) { $img = "<img src=\"" . getPathImage('fw') . "standard/up.png\" alt=\"" . $this->lang->def("_MOVE_UP") . "\" "; $img .= "title=\"" . $this->lang->def("_MOVE_UP") . "\" />"; $url = $um->getUrl("op=movefaqup&catid=" . $cat_id . "&faqid=" . $id); $rowcnt[] = "<a href=\"" . $url . "\">" . $img . "</a>\n"; } else { $rowcnt[] = " "; } $img = "<img src=\"" . getPathImage('fw') . "standard/edit.png\" alt=\"" . $this->lang->def("_MOD") . "\" "; $img .= "title=\"" . $this->lang->def("_MOD") . "\" />"; $url = $um->getUrl("op=editfaq&catid=" . $cat_id . "&faqid=" . $id); $rowcnt[] = "<a href=\"" . $url . "\">" . $img . "</a>\n"; $img = "<img src=\"" . getPathImage('fw') . "standard/delete.png\" alt=\"" . $this->lang->def("_DEL") . "\" "; $img .= "title=\"" . $this->lang->def("_DEL") . "\" />"; $url = $um->getUrl("op=deletefaq&catid=" . $cat_id . "&faqid=" . $id); $rowcnt[] = "<a href=\"" . $url . "\">" . $img . "</a>\n"; $tab->addBody($rowcnt); } $url = $um->getUrl("op=addfaq&catid=" . $cat_id); $tab->addActionAdd("<a class=\"new_element_link\" href=\"" . $url . "\">" . $this->lang->def('_ADD') . "</a>\n"); $res = $tab->getTable() . $tab->getNavBar($ini, $db_tot); return $res; }
function loadAssignField2() { require_once _base_ . '/lib/lib.table.php'; $arr_fields = $_POST[$this->id]['field_set']; $idst_group = $_POST[$this->id]['idst_group']; $idst_desc = $_POST[$this->id]['idst_desc']; require_once $GLOBALS['where_framework'] . '/lib/lib.field.php'; $fl = new FieldList(); $arr_all_fields = $fl->getAllFields(); require_once _base_ . '/lib/lib.form.php'; $form = new Form(); $tree .= $form->openElementSpace(); $tree .= $this->printState(); // print custom fields status $arr_fields_normal = $fl->getFieldsFromIdst(array($idst_group)); $arr_fields_descend = $fl->getFieldsFromIdst(array($idst_desc)); foreach ($arr_fields_descend as $id_field => $field) { $arr_fields_normal[$id_field] = $field; } $tree .= $form->getHidden($this->id . '_idst_group', $this->id . '[idst_group]', $idst_group); $tree .= $form->getHidden($this->id . '_idst_desc', $this->id . '[idst_desc]', $idst_desc); foreach ($arr_fields as $id_filed => $status) { $tree .= $form->getHidden($this->id . '_' . $id_filed, $this->id . '[field_set][' . $id_filed . ']', $status); } /* $tree .= $form->openFormLine(); $tree .= '<div class="label_effect"> </div>'; $tree .= '<div class="label_head">'.$this->lang->def('_MANDATORY').'</div>'; $tree .= '<div class="label_head">'.$this->lang->def('_ORG_CHART_FIELD_WRITE').'</div>'; $tree .= $form->closeFormLine(); */ $tb = new Table(0, $this->lang->def('_TITLE'), $this->lang->def('_TITLE')); $tb->setTableStyle('tree_org_table_field'); $tb->addHeadCustom('<tr class="first_intest">' . '<th scope="col" abbr="' . $this->lang->def('_NAME') . '">' . $this->lang->def('_FIELD_NAME') . '</th>' . '<th scope="col" abbr="' . $this->lang->def('_MANDATORY') . '">' . $this->lang->def('_MANDATORY') . '</th>' . '<th scope="col" abbr="' . $this->lang->def('_ORG_CHART_FIELD_WRITE_ABBR') . '">' . $this->lang->def('_ORG_CHART_FIELD_WRITE') . '</th>' . '</tr>'); // checkbox for mandatory and useraccess foreach ($arr_fields as $id_filed => $status) { if ($status == ORG_CHART_FIELD_NORMAL || $status == ORG_CHART_FIELD_DESCEND) { /*$tree .= $form->openFormLine(); // field title $tree .= '<div class="label_effect">'.$arr_all_fields[$id_filed][FIELD_INFO_TRANSLATION].'</div>'; // checkbox for mandatory $tree .= '<input class="checkbox" type="checkbox"' .' id="'.$this->id.'_'.$id_filed.'_mandatory"' .' name="'.$this->id.'[field_mandatory]['.$id_filed.']"' .' value="true"'; if( isset( $arr_fields_normal[$id_filed] ) && $arr_fields_normal[$id_filed][FIELD_INFO_MANDATORY] == 'true' ) $tree .= ' checked="checked"'; $tree .= ' />'; $tree .= $form->getLabel( $this->id.'_'.$id_filed.'_mandatory', $this->lang->def('_MANDATORY'), 'label_bold access-only' ); // checkbox for useraccess $tree .= '<input class="checkbox" type="checkbox"' .' id="'.$this->id.'_'.$id_filed.'_useraccess"' .' name="'.$this->id.'[field_useraccess]['.$id_filed.']"' .' value="readwrite"'; if( isset( $arr_fields_normal[$id_filed] ) && $arr_fields_normal[$id_filed][FIELD_INFO_USERACCESS] == 'readwrite' ) $tree .= ' checked="checked"'; $tree .= ' />'; $tree .= $form->getLabel( $this->id.'_'.$id_filed.'_useraccess', $this->lang->def('_ORG_CHART_FIELD_WRITE'), 'label_bold access-only' ); $tree .= $form->closeFormLine();*/ $input_manadatory = '<input class="checkbox" type="checkbox"' . ' id="' . $this->id . '_' . $id_filed . '_mandatory"' . ' name="' . $this->id . '[field_mandatory][' . $id_filed . ']"' . ' value="true"'; if (isset($arr_fields_normal[$id_filed]) && $arr_fields_normal[$id_filed][FIELD_INFO_MANDATORY] == 'true') { $input_manadatory .= ' checked="checked"'; } $input_manadatory .= ' />' . $form->getLabel($this->id . '_' . $id_filed . '_mandatory', $this->lang->def('_MANDATORY'), 'label_bold access-only'); $input_useraccess = '<input class="checkbox" type="checkbox"' . ' id="' . $this->id . '_' . $id_filed . '_useraccess"' . ' name="' . $this->id . '[field_useraccess][' . $id_filed . ']"' . ' value="readwrite"'; if (isset($arr_fields_normal[$id_filed]) && $arr_fields_normal[$id_filed][FIELD_INFO_USERACCESS] == 'readwrite') { $input_useraccess .= ' checked="checked"'; } $input_useraccess .= ' />' . $form->getLabel($this->id . '_' . $id_filed . '_useraccess', $this->lang->def('_ORG_CHART_FIELD_WRITE'), 'label_bold access-only'); $tb->addHeadCustom('<tr>' . '<th scope="row">' . $arr_all_fields[$id_filed][FIELD_INFO_TRANSLATION] . '</th>' . '<td>' . $input_manadatory . '</td>' . '<td>' . $input_useraccess . '</td>' . '</tr>'); } } $tree .= $tb->getTable(); $tree .= $form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('save_assignfield' . $this->id, $this->id . '[save_assignfield]', $this->lang->def('_SAVE')) . $form->getButton($this->_getCancelId(), $this->_getCancelId(), $this->lang->def('_UNDO')) . $form->closeButtonSpace(); return $tree; }