public function export() { $postsList = $this->loadTopic($this->getTopicId()); $topicInfo = get_topic_settings($this->getTopicId()); $css = $this->importCss(); $form = new PhpTemplate(get_module_path('CLFRM') . '/templates/forum_export.tpl.php'); $form->assign('forum_id', $topicInfo['forum_id']); $form->assign('topic_id', $topicInfo['topic_id']); $form->assign('notification_bloc', false); $form->assign('topic_subject', $topicInfo['topic_title']); $form->assign('postList', $postsList); $form->assign('claro_notifier', false); $form->assign('is_allowedToEdit', false); $form->assign('date', null); $out = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n" . '<html>' . "\n" . '<head>' . "\n" . '<meta http-equiv="Content-Type" content="text/HTML; charset=' . get_conf('charset') . '" />' . "\n" . '<style type="text/css">' . $css . '</style>' . "\n" . '<title>' . $topicInfo['topic_title'] . '</title>' . "\n" . '</head>' . "\n" . '<body><div id="forumExport">' . "\n"; $out .= $form->render(); $out .= '</div></body>' . "\n" . '</html>'; $path = get_conf('rootSys') . get_conf('tmpPathSys') . '/forum_export/'; $filename = $path . replace_dangerous_char(str_replace(' ', '_', $topicInfo['topic_title']) . '_' . $topicInfo['topic_id']) . '.html'; claro_mkdir($path); file_put_contents($filename, $out); switch ($this->output) { case 'screen': header('Content-Description: File Transfer'); header('Content-Type: application/force-download'); header('Content-Length: ' . filesize($filename)); header('Content-Disposition: attachment; filename=' . basename($filename)); readfile($filename); claro_delete_file($filename); break; case 'file': break; } return true; }
} /*------------------------------------------------------------------------ CREATE DOCUMENT : STEP 1 ------------------------------------------------------------------------*/ // see rqmkhtml.php ... /*= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = EDIT DOCUMENT CONTENT = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ // TODO use the same code as exMkHml if ('exEditHtml' == $cmd) { $_REQUEST['file'] = secure_file_path($_REQUEST['file']); $fp = fopen($baseWorkDir . $_REQUEST['file'], 'w'); if ($fp) { $htmlContent = claro_parse_user_text($_REQUEST['htmlContent']); $template = new PhpTemplate(get_path('incRepositorySys') . '/templates/document_create.tpl.php'); $template->assign('content', $htmlContent); $htmlContent = $template->render(); if (fwrite($fp, $htmlContent)) { $eventNotifier->notifyCourseEvent('document_htmlfile_edited', claro_get_current_course_id(), claro_get_current_tool_id(), $_REQUEST['file'], claro_get_current_group_id(), "0"); $dialogBox->success(get_lang('File content modified')); } } } /*= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = CREATE URL = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ /* * The code begins with STEP 2 * so it allows to return to STEP 1 if STEP 2 unsucceeds */ /*------------------------------------------------------------------------
} if (isset($_REQUEST['officialCode'])) { $userName = $_REQUEST['officialCode']; } else { $officialCode = ''; } if (isset($_REQUEST['mail'])) { $mail = $_REQUEST['mail']; } else { $mail = ''; } $action_list[get_lang('All')] = 'all'; $action_list[get_lang('Student')] = 'followcourse'; $action_list[get_lang('Course creator')] = 'createcourse'; $action_list[get_lang('Platform administrator')] = 'plateformadmin'; //header and bredcrump display ///////////// // OUTPUT $out = ''; $out .= claro_html_tool_title($nameTools . ' : '); $tpl = new PhpTemplate(get_path('incRepositorySys') . '/templates/advancedUserSearch.tpl.php'); $tpl->assign('lastName', $lastName); $tpl->assign('firstName', $firstName); $tpl->assign('userName', $userName); $tpl->assign('officialCode', $officialCode); $tpl->assign('mail', $mail); $tpl->assign('action', $action); $tpl->assign('action_list', $action_list); $out .= $tpl->render(); $claroline->display->body->appendContent($out); echo $claroline->display->render();
// Security check if (!claro_is_user_authenticated()) { claro_disp_auth_form(); } if (!claro_is_platform_admin()) { claro_die(get_lang('Not allowed')); } // table $tbl_used_lang = '`' . get_conf('mainDbName') . '`.`' . get_conf('mainTblPrefix') . TABLE_USED_LANG_VAR . '`'; $tbl_used_translation = '`' . get_conf('mainDbName') . '`.`' . get_conf('mainTblPrefix') . TABLE_TRANSLATION . '`'; $sql1 = " select count(*) from " . $tbl_used_lang; $sql2 = " select count(*) from " . $tbl_used_translation; mysql_query($sql1); if (mysql_errno() == 1146) { $table_exists = FALSE; } mysql_query($sql2); if (mysql_errno() == 1146) { $table_exists = FALSE; } // DISPLAY // Deal with interbredcrumps and title variable ClaroBreadCrumbs::getInstance()->prepend(get_lang('SDK'), $urlSDK); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb')); $tpl = new PhpTemplate(get_path('incRepositorySys') . '/templates/translation_index.tpl.php'); $tpl->assign('table_exists', $table_exists); $out = ''; $out .= claro_html_tool_title($nameTools); $out .= $tpl->render(); $claroline->display->body->appendContent($out); echo $claroline->display->render();
$searchLang = ""; } // Search needed info in db to create the right formulaire $arrayFaculty = course_category_get_list(); $category_array = claro_get_cat_flat_list(); $category_array = array_merge(array(get_lang('All') => ''), $category_array); $language_list = claro_get_lang_flat_list(); $language_list = array_merge(array(get_lang('All') => ''), $language_list); //---------------------------------- // DISPLAY //---------------------------------- $out = ''; //tool title $out .= claro_html_tool_title($nameTools . ' : '); $tpl = new PhpTemplate(get_path('incRepositorySys') . '/templates/advancedCourseSearch.tpl.php'); $tpl->assign('code', $code); $tpl->assign('intitule', $intitule); $tpl->assign('category_array', $category_array); $tpl->assign('language_list', $language_list); $tpl->assign('access', $access); $tpl->assign('subscription', $subscription); $tpl->assign('visibility', $visibility); $out .= $tpl->render(); $claroline->display->body->appendContent($out); echo $claroline->display->render(); //NEEDED FUNCTION (to be moved in libraries) /** *This function create de select box to choose categories * * @author - < Benoît Muret > * @param - elem array : the faculties