本文整理汇总了PHP中api_get_text_direction函数的典型用法代码示例。如果您正苦于以下问题:PHP api_get_text_direction函数的具体用法?PHP api_get_text_direction怎么用?PHP api_get_text_direction使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了api_get_text_direction函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: classicAction
/**
* Handles default Chamilo scripts handled by Display::display_header() and display_footer()
*
* @param \Silex\Application $app
* @param string $file
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response|void
*/
public function classicAction(Application $app, $file)
{
$responseHeaders = array();
/** @var Request $request */
$request = $app['request'];
// get.
$_GET = $request->query->all();
// post.
$_POST = $request->request->all();
// echo $request->getMethod();
//$_REQUEST = $request->request->all();
$mainPath = $app['paths']['sys_root'] . 'main/';
$fileToLoad = $mainPath . $file;
if (is_file($fileToLoad) && \Security::check_abs_path($fileToLoad, $mainPath)) {
// Default values
$_course = api_get_course_info();
$_user = api_get_user_info();
$charset = 'UTF-8';
$debug = $app['debug'];
$text_dir = api_get_text_direction();
$is_platformAdmin = api_is_platform_admin();
$_cid = api_get_course_id();
// Loading file
ob_start();
require_once $mainPath . $file;
$out = ob_get_contents();
ob_end_clean();
// No browser cache when executing an exercise.
if ($file == 'exercice/exercise_submit.php') {
$responseHeaders = array('cache-control' => 'no-store, no-cache, must-revalidate');
}
// Setting page header/footer conditions (important for LPs)
$app['template']->setFooter($app['template.show_footer']);
$app['template']->setHeader($app['template.show_header']);
if (isset($htmlHeadXtra)) {
$app['template']->addJsFiles($htmlHeadXtra);
}
if (isset($interbreadcrumb)) {
$app['template']->setBreadcrumb($interbreadcrumb);
$app['template']->loadBreadcrumbToTemplate();
}
if (isset($tpl)) {
$response = $app['twig']->render($app['default_layout']);
} else {
$app['template']->assign('content', $out);
$response = $app['twig']->render($app['default_layout']);
}
} else {
return $app->abort(404, 'File not found');
}
return new Response($response, 200, $responseHeaders);
}
示例2: getEmptyTemplate
/**
* Get the empty template
* @return array
*/
private function getEmptyTemplate()
{
return [['title' => get_lang('EmptyTemplate'), 'description' => null, 'image' => api_get_path(WEB_APP_PATH) . 'home/default_platform_document/template_thumb/empty.gif', 'html' => '
<!DOCYTPE html>
<html>
<head>
<meta charset="' . api_get_system_encoding() . '" />
</head>
<body dir="' . api_get_text_direction() . '">
<p>
<br/>
</p>
</body>
</html>
</html>
']];
}
示例3: format_pdf
/**
* Pre-formats a PDF to the right size and, if not stated otherwise, with
* header, footer and watermark (if any)
* @param array $course_data General course information (to fill headers)
* @param bool $complete Whether we want headers, footers and watermark or not
*/
public function format_pdf($course_data, $complete = true)
{
if ($complete === false) {
error_log('Asked with no decoration');
}
$course_code = null;
if (!empty($course_data)) {
$course_code = $course_data['code'];
}
/*$pdf->SetAuthor('Documents Chamilo');
$pdf->SetTitle('title');
$pdf->SetSubject('Exported from Chamilo Documents');
$pdf->SetKeywords('Chamilo Documents');
*/
// TODO: To be read from the html document.
$this->pdf->directionality = api_get_text_direction();
$this->pdf->useOnlyCoreFonts = true;
// Use different Odd/Even headers and footers and mirror margins
$this->pdf->mirrorMargins = 1;
// Add decoration only if not stated otherwise
if ($complete) {
// Adding watermark
if (api_get_setting('pdf_export_watermark_enable') == 'true') {
$watermark_file = self::get_watermark($course_code);
if ($watermark_file) {
//http://mpdf1.com/manual/index.php?tid=269&searchstring=watermark
$this->pdf->SetWatermarkImage($watermark_file);
$this->pdf->showWatermarkImage = true;
} else {
$watermark_file = self::get_watermark(null);
if ($watermark_file) {
$this->pdf->SetWatermarkImage($watermark_file);
$this->pdf->showWatermarkImage = true;
}
}
if ($course_code) {
$watermark_text = api_get_course_setting('pdf_export_watermark_text');
if (empty($watermark_text)) {
$watermark_text = api_get_setting('pdf_export_watermark_text');
}
} else {
$watermark_text = api_get_setting('pdf_export_watermark_text');
}
if (!empty($watermark_text)) {
$this->pdf->SetWatermarkText(strcode2utf($watermark_text),0.1);
$this->pdf->showWatermarkText = true;
}
}
if (empty($this->custom_header)) {
self::set_header($course_data);
} else {
$this->pdf->SetHTMLHeader($this->custom_header,'E');
$this->pdf->SetHTMLHeader($this->custom_header,'O');
}
if (empty($this->custom_footer)) {
self::set_footer();
} else {
$this->pdf->SetHTMLFooter($this->custom_footer);
}
}
}
示例4: unserialize
*/
/**
* Code
*/
// Flag to allow for anonymous user - needs to be set before global.inc.php.
$use_anonymous = true;
require_once '../inc/global.inc.php';
require_once 'learnpath.class.php';
require_once 'scorm.class.php';
require_once 'aicc.class.php';
if (isset($_SESSION['lpobject'])) {
$oLP = unserialize($_SESSION['lpobject']);
if (is_object($oLP)) {
$_SESSION['oLP'] = $oLP;
} else {
die('Could not instanciate lp object.');
}
}
$lp_theme_css = $_SESSION['oLP']->get_theme();
$scorm_css_header = true;
Display::display_reduced_header();
echo '<body dir="' . api_get_text_direction() . '">';
echo '<div id="audiorecorder"> ';
$audio_recorder_studentview = 'true';
$audio_recorder_item_id = $_SESSION['oLP']->current;
if (api_get_setting('service_visio', 'active') == 'true') {
require_once 'audiorecorder.inc.php';
}
echo '</div>';
// end of audiorecorder include
echo '</body></html>';
示例5: showQuestion
/**
* Shows a question
*
* @param int $questionId question id
* @param bool $only_questions if true only show the questions, no exercise title
* @param bool $origin i.e = learnpath
* @param string $current_item current item from the list of questions
* @param bool $show_title
* @param bool $freeze
* @param array $user_choice
* @param bool $show_comment
* @param bool $exercise_feedback
* @param bool $show_answers
* */
function showQuestion($questionId, $only_questions = false, $origin = false, $current_item = '', $show_title = true, $freeze = false, $user_choice = array(), $show_comment = false, $exercise_feedback = null, $show_answers = false)
{
// Text direction for the current language
$is_ltr_text_direction = api_get_text_direction() != 'rtl';
// Change false to true in the following line to enable answer hinting
$debug_mark_answer = $show_answers;
//api_is_allowed_to_edit() && false;
// Reads question information
if (!($objQuestionTmp = Question::read($questionId))) {
// Question not found
return false;
}
if ($exercise_feedback != EXERCISE_FEEDBACK_TYPE_END) {
$show_comment = false;
}
$answerType = $objQuestionTmp->selectType();
$pictureName = $objQuestionTmp->selectPicture();
$s = '';
if ($answerType != HOT_SPOT && $answerType != HOT_SPOT_DELINEATION) {
// Question is not a hotspot
if (!$only_questions) {
$questionDescription = $objQuestionTmp->selectDescription();
if ($show_title) {
Testcategory::displayCategoryAndTitle($objQuestionTmp->id);
echo Display::div($current_item . '. ' . $objQuestionTmp->selectTitle(), array('class' => 'question_title'));
}
if (!empty($questionDescription)) {
echo Display::div($questionDescription, array('class' => 'question_description'));
}
}
if (in_array($answerType, array(FREE_ANSWER, ORAL_EXPRESSION)) && $freeze) {
return '';
}
echo '<div class="question_options">';
// construction of the Answer object (also gets all answers details)
$objAnswerTmp = new Answer($questionId);
$nbrAnswers = $objAnswerTmp->selectNbrAnswers();
$course_id = api_get_course_int_id();
$quiz_question_options = Question::readQuestionOption($questionId, $course_id);
// For "matching" type here, we need something a little bit special
// because the match between the suggestions and the answers cannot be
// done easily (suggestions and answers are in the same table), so we
// have to go through answers first (elems with "correct" value to 0).
$select_items = array();
//This will contain the number of answers on the left side. We call them
// suggestions here, for the sake of comprehensions, while the ones
// on the right side are called answers
$num_suggestions = 0;
if ($answerType == MATCHING) {
$s .= '<table class="data_table">';
// Iterate through answers
$x = 1;
//mark letters for each answer
$letter = 'A';
$answer_matching = array();
$cpt1 = array();
for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
$answerCorrect = $objAnswerTmp->isCorrect($answerId);
$numAnswer = $objAnswerTmp->selectAutoId($answerId);
$answer = $objAnswerTmp->selectAnswer($answerId);
if ($answerCorrect == 0) {
// options (A, B, C, ...) that will be put into the list-box
// have the "correct" field set to 0 because they are answer
$cpt1[$x] = $letter;
$answer_matching[$x] = $objAnswerTmp->selectAnswerByAutoId($numAnswer);
$x++;
$letter++;
}
}
$i = 1;
$select_items[0]['id'] = 0;
$select_items[0]['letter'] = '--';
$select_items[0]['answer'] = '';
foreach ($answer_matching as $id => $value) {
$select_items[$i]['id'] = $value['id'];
$select_items[$i]['letter'] = $cpt1[$id];
$select_items[$i]['answer'] = $value['answer'];
$i++;
}
$user_choice_array_position = array();
if (!empty($user_choice)) {
foreach ($user_choice as $item) {
$user_choice_array_position[$item['position']] = $item['answer'];
}
}
$num_suggestions = $nbrAnswers - $x + 1;
//.........这里部分代码省略.........
示例6: api_get_text_direction
<?php
/* For licensing terms, see /license.txt */
/**
* Header of each frame of the Chat tool
*
* @author Olivier Brouckaert
* Modified by Denes Nagy
* @package chamilo.chat
*/
require_once '../inc/global.inc.php';
if (!defined('FRAME')) {
exit;
}
$bodyXtra = ' class="course_chat" dir="' . api_get_text_direction() . '" ';
if (FRAME == 'hidden') {
$bodyXtra .= 'onload="javascript: updateChat(); updateConnected(); setTimeout(\'submitHiddenForm();\', 5000);"';
// Change timeout to change refresh time of the chat window
} elseif (FRAME == 'message') {
$bodyXtra .= 'onload="javascript: eventMessage();"';
}
$mycourseid = api_get_cidreq();
if (empty($mycourseid)) {
// If it is not set $mycourse id we reload the chat_message window in order to hide the textarea to submit a message.
echo '<script type="text/javascript" language="javascript">';
echo "parent.chat_message.location.href='chat_whoisonline.php?" . api_get_cidreq() . "';";
echo '</script>';
}
/*
* Choose CSS style (platform's, user's, or course's)
*/
示例7: array
/**
* This method determines editor's interface language and returns it as compatible with the editor langiage code.
* @return array
*/
private function &get_editor_language()
{
static $config;
if (!is_array($config)) {
$code_translation_table = array('' => 'en', 'sr' => 'sr-latn', 'zh' => 'zh-cn', 'zh-tw' => 'zh');
$editor_lang = strtolower(str_replace('_', '-', api_get_language_isocode()));
$editor_lang = isset($code_translation_table[$editor_lang]) ? $code_translation_table[$editor_lang] : $editor_lang;
$editor_lang = file_exists(api_get_path(SYS_PATH) . 'main/inc/lib/fckeditor/editor/lang/' . $editor_lang . '.js') ? $editor_lang : 'en';
$config['DefaultLanguage'] = $editor_lang;
$config['ContentLangDirection'] = api_get_text_direction($editor_lang);
}
return $config;
}
示例8: error_log
error_log('New LP - Loaded lp_save : ' . $_SERVER['REQUEST_URI'] . ' from ' . $_SERVER['HTTP_REFERER'], 0);
?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php
echo api_get_language_isocode();
?>
" lang="<?php
echo api_get_language_isocode();
?>
">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php
echo api_get_system_encoding();
?>
" />
<script language='javascript'>
<?php
if ($_SESSION['oLP']->mode != 'fullscreen') {
}
?>
</script>
</head>
<body dir="<?php
echo api_get_text_direction();
?>
">
</body></html>
示例9: api_get_text_direction
// if the sub-languages feature is not on, then just load the
// set language interface
// include English
include $langpath . 'english/trad4all.inc.php';
// prepare string for current language
$langfile = $langpath . $language_interface . '/trad4all.inc.php';
if (file_exists($langfile)) {
include $langfile;
}
}
// include the local (contextual) parameters of this course or section
require $includePath . '/local.inc.php';
// The global variable $text_dir has been defined in the language file trad4all.inc.php.
// For determining text direction correspondent to the current language
// we use now information from the internationalization library.
$text_dir = api_get_text_direction();
// ===== "who is logged in?" module section =====
// check and modify the date of user in the track.e.online table
if (!($x = strpos($_SERVER['PHP_SELF'], 'whoisonline.php'))) {
preventMultipleLogin($_user["user_id"]);
LoginCheck(isset($_user['user_id']) ? $_user['user_id'] : '');
}
// ===== end "who is logged in?" module section =====
//Update of the logout_date field in the table track_e_login
// (needed for the calculation of the total connection time)
if (!isset($_SESSION['login_as']) && isset($_user)) {
// if $_SESSION['login_as'] is set, then the user is an admin logged as the user
$tbl_track_login = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql = "SELECT login_id, login_date\n FROM {$tbl_track_login}\n WHERE\n login_user_id='" . $_user["user_id"] . "'\n ORDER BY login_date DESC\n LIMIT 0,1";
$q_last_connection = Database::query($sql);
if (Database::num_rows($q_last_connection) > 0) {
示例10: print_table
/**
* Prints an HTML page with a table containing the gradebook data
* @param array Array containing the data to be printed in the table
* @param array Table headers
* @param string View to print as a title for the table
* @param string Course name to print as title for the table
*/
function print_table($data_array, $header_names, $view, $coursename)
{
$printdata = '<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . api_get_language_isocode() . '" lang="' . api_get_language_isocode() . '">
<head>
<title>' . get_lang('Print') . '</title>
<meta http-equiv="Content-Type" content="text/html; charset=' . api_get_system_encoding() . '" />
<style type="text/css">
body {
font-size: 12px;
color: #000;
margin: 10px;
padding: 0;
}
a:link {text-decoration: none; font-weight : bold; color : black;}
a:visited {text-decoration: none; font-weight : bold; color : black;}
a:active {text-decoration: none; font-weight : bold; color : black;}
.data_table{
border-collapse: collapse;
width: 100%;
padding: 5px;
border: 1px;
}
.data_table th{
padding: 5px;
vertical-align: top;
border-top: 1px solid black;
border-bottom: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
}
.data_table tr.row_odd{
background-color: #fafafa;
}
.data_table tr.row_even{
background-color: #fff;
}
.data_table td{
padding: 5px;
vertical-align: top;
border-bottom: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
}
</style>
</head>
<body dir="' . api_get_text_direction() . '"><div id="main">';
$printdata .= '<h2>' . $view . ' : ' . $coursename . '</h2>';
//@todo not necessary here
//$printdata .= '<h3>'.get_lang('Date').' : '.api_convert_and_format_date(null, DATE_FORMAT_SHORT). ' ' . api_convert_and_format_date(null, TIME_NO_SEC_FORMAT).'</h3>';
$printdata .= '<table border="1" width="90%" cellspacing="1" cellpadding="1">';
foreach ($header_names as $header) {
$printdata .= '<th>' . $header . '</th>';
}
foreach ($data_array as $data) {
$printdata .= '<tr>';
foreach ($data as $rowdata) {
$printdata .= '<td>' . $rowdata . '</td>';
}
$printdata .= '</tr>';
}
$printdata .= '</table></div></body></html>';
return $printdata;
}
示例11: function
success: function(datos) {
if (datos == 'required_field_error') {
message = "<?php echo get_lang('FormHasErrorsPleaseComplete') ?>";
} else if (datos == '1') {
message = "<?php echo get_lang('ContactInformationHasBeenSent') ?>";
} else {
message = "<?php echo get_lang('Error').': '.get_lang('ContactInformationHasNotBeenSent') ?>";
}
alert(message);
}
});
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>" />
</head>
<body dir="<?php echo api_get_text_direction(); ?>" class="install-chamilo">
<div id="wrapper">
<div id="main" class="container well-install">
<header>
<div class="row">
<div id="header_left" class="span4">
<div id="logo">
<img src="../css/chamilo/images/header-logo.png" hspace="10" vspace="10" alt="Chamilo" />
</div>
</div>
</div>
<div class="navbar subnav">
<div class="navbar-inner">
<div class="container">
<div class="nav-collapse">
示例12: api_get_language_isocode
Possible values: true, false
TRUE - If set to true, uploaded files will be validated based on the
function getImageSize, if we can get the image dimensions then
I guess this should be a valid image. Otherwise the file will be rejected.
FALSE - All uploaded files will be processed.
NOTE: If uploading is not allowed, this parameter is ignored.
*/
$IMConfig['validate_images'] = true;
/*
The default thumbnail if the thumbnails can not be created, either
due to error or bad image file.
*/
$IMConfig['default_thumbnail'] = 'img/default.gif';
/*
Thumbnail dimensions.
*/
$IMConfig['thumbnail_width'] = 96;
$IMConfig['thumbnail_height'] = 96;
/*
Image Editor temporary filename prefix.
*/
$IMConfig['tmp_prefix'] = '.editor_';
/*
Language and text direction.
*/
$IMConfig['language'] = api_get_language_isocode();
$IMConfig['text_direction'] = api_get_text_direction($IMConfig['language']);
示例13: setHeaderParameters
/**
* Set header parameters
*/
private function setHeaderParameters()
{
$_course = api_get_course_info();
$_configuration = $this->app->getConfiguration();
$this_section = $this->app['this_section'];
$nameTools = $this->title;
$navigation = $this->navigation_array;
$this->menu_navigation = $navigation['menu_navigation'];
$this->assign('system_charset', api_get_system_encoding());
$this->assign('online_button', Display::return_icon('online.png'));
$this->assign('offline_button', Display::return_icon('offline.png'));
// Get language iso-code for this page - ignore errors
$this->assign('document_language', $this->translator->getLocale());
$course_title = isset($_course['name']) ? $_course['name'] : null;
$title_list = array();
$title_list[] = api_get_setting('platform.institution');
$title_list[] = api_get_setting('platform.site_name');
if (!empty($course_title)) {
$title_list[] = $course_title;
}
if ($nameTools != '') {
$title_list[] = $nameTools;
}
$title_string = '';
for ($i = 0; $i < count($title_list); $i++) {
$title_string .= $title_list[$i];
if (isset($title_list[$i + 1])) {
$item = trim($title_list[$i + 1]);
if (!empty($item)) {
$title_string .= ' - ';
}
}
}
$this->assign('title_string', $title_string);
// Setting the theme and CSS files.
$this->setCssFiles();
$this->setJsFiles();
// Implementation of prefetch.
// See http://cdn.chamilo.org/main/img/online.png for details
$prefetch = '';
if (!empty($_configuration['cdn_enable'])) {
$prefetch .= '<meta http-equiv="x-dns-prefetch-control" content="on">';
foreach ($_configuration['cdn'] as $host => $exts) {
$prefetch .= '<link rel="dns-prefetch" href="' . $host . '">';
}
}
$this->assign('prefetch', $prefetch);
$this->assign('text_direction', api_get_text_direction());
$this->assign('section_name', 'section-' . $this_section);
$favico = '<link rel="shortcut icon" href="' . api_get_path(WEB_PATH) . 'favicon.ico" type="image/x-icon" />';
/*if (isset($_configuration['multiple_access_urls']) &&
$_configuration['multiple_access_urls']) {
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1) {
$url_info = api_get_current_access_url_info();
$url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $url_info['url']));
$clean_url = api_replace_dangerous_char($url);
$clean_url = str_replace('/', '-', $clean_url);
$clean_url .= '/';
$homep = api_get_path(REL_PATH).'home/'.$clean_url; //homep for Home Path
$icon_real_homep = api_get_path(SYS_PATH).'home/'.$clean_url;
//we create the new dir for the new sites
if (is_file($icon_real_homep.'favicon.ico')) {
$favico = '<link rel="shortcut icon" href="'.$homep.'favicon.ico" type="image/x-icon" />';
}
}
}*/
//$this->assign('favico', $favico);
$this->setHelp();
$notification = $this->returnNotificationMenu();
$this->assign('notification_menu', $notification);
// Profile link.
$this->assign('is_profile_editable', api_is_profile_readable());
$visibility = api_is_allowed_to_create_course() ? \SystemAnnouncementManager::VISIBLE_TEACHER : \SystemAnnouncementManager::VISIBLE_STUDENT;
$announcements = \SystemAnnouncementManager::getAnnouncements($visibility, null, 'resumed', false, 50);
$this->assign('news_counter', count($announcements));
$this->assign('news_list', $announcements);
$profile_link = null;
if (api_get_setting('social.allow_social_tool') == 'true') {
$profile_link = $this->urlGenerator->generate('root') . 'social/home.php';
} else {
if (api_is_profile_readable()) {
$profile_link = $this->urlGenerator->generate('root') . 'auth/profile.php';
}
}
$this->assign('profile_link', $profile_link);
$this->assign('settings_link', $this->urlGenerator->generate('root') . 'auth/profile.php');
// Message link.
$messageUrl = null;
if (api_get_setting('message.allow_message_tool') == 'true') {
$messageUrl = $this->urlGenerator->generate('root') . 'messages/inbox.php';
}
$this->assign('message_link', $messageUrl);
$institution = api_get_setting('platform.institution');
$portal_name = empty($institution) ? api_get_setting('platform.site_name') : $institution;
$this->assign('portal_name', $portal_name);
//.........这里部分代码省略.........
示例14: set_header_parameters
/**
* Set header parameters
* @param bool $sendHeaders send headers
*/
private function set_header_parameters($sendHeaders)
{
global $httpHeadXtra, $interbreadcrumb, $language_file, $_configuration, $this_section;
$_course = api_get_course_info();
$help = $this->help;
$nameTools = $this->title;
$navigation = return_navigation_array();
$this->menu_navigation = $navigation['menu_navigation'];
$this->assign('system_charset', api_get_system_encoding());
if (isset($httpHeadXtra) && $httpHeadXtra) {
foreach ($httpHeadXtra as &$thisHttpHead) {
header($thisHttpHead);
}
}
$this->assign('online_button', Display::return_icon('statusonline.png', null, null, ICON_SIZE_ATOM));
$this->assign('offline_button', Display::return_icon('statusoffline.png', null, null, ICON_SIZE_ATOM));
// Get language iso-code for this page - ignore errors
$this->assign('document_language', api_get_language_isocode());
$course_title = isset($_course['name']) ? $_course['name'] : null;
$title_list = array();
$title_list[] = api_get_setting('platform.institution');
$title_list[] = api_get_setting('platform.site_name');
if (!empty($course_title)) {
$title_list[] = $course_title;
}
if ($nameTools != '') {
$title_list[] = $nameTools;
}
$title_string = '';
for ($i = 0; $i < count($title_list); $i++) {
$title_string .= $title_list[$i];
if (isset($title_list[$i + 1])) {
$item = trim($title_list[$i + 1]);
if (!empty($item)) {
$title_string .= ' - ';
}
}
}
$this->assign('title_string', $title_string);
//Setting the theme and CSS files
$css = $this->setCssFiles();
$this->set_js_files();
$this->setCssCustomFiles($css);
//$this->set_js_files_post();
$browser = api_browser_support('check_browser');
if ($browser[0] == 'Internet Explorer' && $browser[1] >= '11') {
$browser_head = '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />';
$this->assign('browser_specific_head', $browser_head);
}
// Implementation of prefetch.
// See http://cdn.chamilo.org/main/img/online.png for details
$prefetch = '';
if (!empty($_configuration['cdn_enable'])) {
$prefetch .= '<meta http-equiv="x-dns-prefetch-control" content="on">';
foreach ($_configuration['cdn'] as $host => $exts) {
$prefetch .= '<link rel="dns-prefetch" href="' . $host . '">';
}
}
$this->assign('prefetch', $prefetch);
$this->assign('text_direction', api_get_text_direction());
$this->assign('section_name', 'section-' . $this_section);
//Defaul root chamilo favicon
$favico = '<link rel="shortcut icon" href="' . api_get_path(WEB_PATH) . 'favicon.ico" type="image/x-icon" />';
//Added to verify if in the current Chamilo Theme exist a favicon
$favicoThemeUrl = api_get_path(SYS_CSS_PATH) . 'themes/' . $this->theme . '/images/';
//If exist pick the current chamilo theme favicon
if (is_file($favicoThemeUrl . 'favicon.ico')) {
$favico = '<link rel="shortcut icon" href="' . api_get_path(WEB_CSS_PATH) . 'themes/' . $this->theme . '/images/favicon.ico" type="image/x-icon" />';
}
if (api_is_multiple_url_enabled()) {
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1) {
$url_info = api_get_access_url($access_url_id);
$url = api_remove_trailing_slash(preg_replace('/https?:\\/\\//i', '', $url_info['url']));
$clean_url = api_replace_dangerous_char($url);
$clean_url = str_replace('/', '-', $clean_url);
$clean_url .= '/';
$homep = api_get_path(REL_PATH) . 'home/' . $clean_url;
//homep for Home Path
$icon_real_homep = api_get_path(SYS_APP_PATH) . 'home/' . $clean_url;
//we create the new dir for the new sites
if (is_file($icon_real_homep . 'favicon.ico')) {
$favico = '<link rel="shortcut icon" href="' . $homep . 'favicon.ico" type="image/x-icon" />';
}
}
}
$this->assign('favico', $favico);
$this->setHelp();
//@todo move this in the template
$bug_notification_link = '';
if (api_get_setting('show_link_bug_notification') == 'true' && $this->user_is_logged_in) {
$bug_notification_link = '<li class="report">
<a href="http://support.chamilo.org/projects/chamilo-18/wiki/How_to_report_bugs" target="_blank">
<img src="' . api_get_path(WEB_IMG_PATH) . 'bug.large.png" style="vertical-align: middle;" alt="' . get_lang('ReportABug') . '" title="' . get_lang('ReportABug') . '"/></a>
</li>';
}
//.........这里部分代码省略.........
示例15: generate_html_overview
/**
* @desc Generates the contents of a html file that gives an overview of all the files in the zip file.
* This is to know the information of the files that are inside the zip file (who send it, the comment, ...)
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, March 2006
* @author Ivan Tcholakov, 2010, code for html metadata has been added.
*/
function generate_html_overview($files, $dont_show_columns = array(), $make_link = array())
{
$return = '<!DOCTYPE html' . "\n";
$return .= "\t" . 'PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"' . "\n";
$return .= "\t" . '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n";
$return .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . api_get_language_isocode() . '" lang="' . api_get_language_isocode() . '">' . "\n";
$return .= "<head>\n\t<title>" . get_lang('OverviewOfFilesInThisZip') . "</title>\n";
$return .= "\t" . '<meta http-equiv="Content-Type" content="text/html; charset=' . api_get_system_encoding() . '" />' . "\n";
$return .= "</head>\n\n";
$return .= '<body dir="' . api_get_text_direction() . '">' . "\n\n";
$return .= "<table border=\"1px\">\n";
$counter = 0;
foreach ($files as $value) {
// Adding the header.
if ($counter == 0) {
$columns_array = array_keys($value);
$return .= "\n<tr>";
foreach ($columns_array as $columns_array_key => $columns_array_value) {
if (!in_array($columns_array_value, $dont_show_columns)) {
$return .= "\n\t<th>" . $columns_array_value . "</th>";
}
$column[] = $columns_array_value;
}
$return .= "\n</tr>\n";
}
$counter++;
// Adding the content.
$return .= "\n<tr>";
foreach ($column as $column_key => $column_value) {
if (!in_array($column_value, $dont_show_columns)) {
$return .= "\n\t<td>";
if (in_array($column_value, $make_link)) {
$return .= '<a href="' . $value[$column_value] . '">' . $value[$column_value] . '</a>';
} else {
$return .= $value[$column_value];
}
$return .= "</td>";
}
}
$return .= "\n</tr>\n";
}
$return .= "\n</table>\n\n</body>";
$return .= "\n</html>";
return $return;
}