Replace question_title_html with save_titles_like_html - refs BT#12441 BT#12538

pull/2487/head
Angel Fernando Quiroz Campos 8 years ago
parent 7c2651545d
commit e7406cf633
  1. 13
      main/admin/course_category.php
  2. 12
      main/course_description/add.php
  3. 14
      main/course_description/edit.php
  4. 2
      main/course_description/listing.php
  5. 10
      main/course_progress/index.php
  6. 10
      main/course_progress/thematic.php
  7. 2
      main/course_progress/thematic_controller.php
  8. 10
      main/exercise/exercise.class.php
  9. 6
      main/exercise/question.class.php
  10. 2
      main/inc/ajax/course.ajax.php
  11. 2
      main/inc/introductionSection.inc.php
  12. 4
      main/install/configuration.dist.php
  13. 8
      main/template/default/course_progress/pdf_single_thematic.tpl

@ -85,10 +85,21 @@ if ($action == 'add' || $action == 'edit') {
$form = new FormValidator('course_category', 'post', $url);
$form->addElement('header', '', $form_title);
$form->addElement('hidden', 'formSent', 1);
$form->addElement('text', 'code', get_lang("CategoryCode"));
if (api_get_configuration_value('save_titles_like_html')) {
$form->addHtmlEditor(
'name',
get_lang('CategoryName'),
true,
false,
['ToolbarSet' => 'Minimal']
);
} else {
$form->addElement('text', 'name', get_lang("CategoryName"));
$form->addRule('name', get_lang('PleaseEnterCategoryInfo'), 'required');
}
$form->addRule('code', get_lang('PleaseEnterCategoryInfo'), 'required');
$group = array(
$form->createElement(

@ -56,8 +56,18 @@ $form = new FormValidator(
);
$form->addElement('header', $header);
$form->addElement('hidden', 'description_type', $description_type);
$form->addText('title', get_lang('Title'), true);
if (api_get_configuration_value('save_titles_like_html')) {
$form->addHtmlEditor(
'title',
get_lang('Title'),
true,
false,
['ToolbarSet' => 'Minimal']
);
} else {
$form->addText('title', get_lang('Title'));
$form->applyFilter('title', 'html_filter');
}
$form->addHtmlEditor(
'contentDescription',
get_lang('Content'),

@ -72,13 +72,23 @@ $form = new FormValidator(
'POST',
'index.php?action=edit&id='.$original_id.'&description_type='.$description_type.'&'.api_get_cidreq()
);
$form->addElement('header', $header);
$form->addElement('hidden', 'id', $original_id);
$form->addElement('hidden', 'description_type', $description_type);
$form->addElement('hidden', 'sec_token', $token);
$form->addText('title', get_lang('Title'), true, array('size' => '50'));
if (api_get_configuration_value('save_titles_like_html')) {
$form->addHtmlEditor(
'title',
get_lang('Title'),
true,
false,
['ToolbarSet' => 'Minimal']
);
} else {
$form->addText('title', get_lang('Title'));
$form->applyFilter('title', 'html_filter');
}
$form->addHtmlEditor(
'contentDescription',
get_lang('Content'),

@ -71,7 +71,7 @@ if (isset($descriptions) && count($descriptions) > 0) {
}
echo Display::panel(
$description['content'],
$description['title'].$actions,
"<div class='pull-right'>$actions</div>{$description['title']}",
'',
'info'
);

@ -80,7 +80,7 @@ if (!empty($thematic_id)) {
// thematic data by id
$thematic_data = $thematic->get_thematic_list($thematic_id);
}
$cleanThematicTitle = isset($thematic_data['title']) ? strip_tags($thematic_data['title']) : null;
// get default thematic plan title
$default_thematic_plan_title = $thematic->get_default_thematic_plan_title();
@ -209,13 +209,13 @@ if ($action == 'thematic_plan_list' || $action == 'thematic_plan_delete') {
if (!empty($thematic_data)) {
$interbreadcrumb[] = array(
'url' => '#',
'name' => get_lang('ThematicPlan').' ('.$thematic_data['title'].') '
'name' => get_lang('ThematicPlan').' ('.$cleanThematicTitle.') '
);
}
}
if ($action == 'thematic_plan_add' || $action == 'thematic_plan_edit') {
$interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl'));
$interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic_id, 'name' => get_lang('ThematicPlan').' ('.$thematic_data['title'].')');
$interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic_id, 'name' => get_lang('ThematicPlan').' ('.$cleanThematicTitle.')');
if ($description_type >= ADD_THEMATIC_PLAN) {
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewBloc'));
} else {
@ -224,11 +224,11 @@ if ($action == 'thematic_plan_add' || $action == 'thematic_plan_edit') {
}
if ($action == 'thematic_advance_list' || $action == 'thematic_advance_delete') {
$interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('ThematicAdvance').' ('.$thematic_data['title'].')');
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('ThematicAdvance').' ('.$cleanThematicTitle.')');
}
if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
$interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl'));
$interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic_id, 'name' => get_lang('ThematicAdvance').' ('.$thematic_data['title'].')');
$interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic_id, 'name' => get_lang('ThematicAdvance').' ('.$cleanThematicTitle.')');
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewThematicAdvance'));
}

@ -190,7 +190,17 @@ if ($action == 'thematic_list') {
$form->addElement('hidden', 'thematic_id', $thematic_id);
}
if (api_get_configuration_value('save_titles_like_html')) {
$form->addHtmlEditor(
'title',
get_lang('Title'),
true,
false,
['ToolbarSet' => 'Minimal']
);
} else {
$form->addText('title', get_lang('Title'), true, array('size' => '50'));
}
$form->addHtmlEditor('content', get_lang('Content'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Height' => '150'));
$form->addButtonSave(get_lang('Save'));

@ -167,7 +167,7 @@ class ThematicController
$csv = array();
$csv[] = array('type', 'data1', 'data2', 'data3');
foreach ($list as $theme) {
$csv[] = array('title', $theme['title'], $theme['content']);
$csv[] = array('title', strip_tags($theme['title']), strip_tags($theme['content']));
$data = $thematic->get_thematic_plan_data($theme['id']);
if (!empty($data)) {
foreach ($data as $plan) {

@ -1819,12 +1819,22 @@ class Exercise
$form->addElement('header', $form_title);
// Title.
if (api_get_configuration_value('save_titles_like_html')) {
$form->addHtmlEditor(
'exerciseTitle',
get_lang('ExerciseName'),
false,
false,
['ToolbarSet' => 'Minimal']
);
} else {
$form->addElement(
'text',
'exerciseTitle',
get_lang('ExerciseName'),
array('id' => 'exercise_title')
);
}
$form->addElement('advanced_settings', 'advanced_params', get_lang('AdvancedParameters'));
$form->addElement('html', '<div id="advanced_params_options" style="display:none">');

@ -191,7 +191,7 @@ abstract class Question
*/
public function selectTitle()
{
if (!api_get_configuration_value('question_title_html')) {
if (!api_get_configuration_value('save_titles_like_html')) {
return $this->question;
}
@ -204,7 +204,7 @@ abstract class Question
*/
public function getTitleToDisplay($itemNumber)
{
$showQuestionTitleHtml = api_get_configuration_value('question_title_html');
$showQuestionTitleHtml = api_get_configuration_value('save_titles_like_html');
$title = $showQuestionTitleHtml ? '' : '<strong>';
$title .= $itemNumber.'. '.$this->selectTitle();
@ -1558,7 +1558,7 @@ abstract class Question
</script>';
// question name
if (api_get_configuration_value('question_title_html')) {
if (api_get_configuration_value('save_titles_like_html')) {
$editorConfig = ['ToolbarSet' => 'Minimal'];
$form->addHtmlEditor('questionName', get_lang('Question'), false, false, $editorConfig, true);
} else {

@ -63,7 +63,7 @@ switch ($action) {
foreach ($categories as $item) {
$list['items'][] = [
'id' => $item['code'],
'text' => '('.$item['code'].') '.$item['name']
'text' => '('.$item['code'].') '.strip_tags($item['name'])
];
}

@ -266,7 +266,7 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
<div class="col-md-6 items-progress">
<div class="thematic-cont '.$class1.'">
<div class="topics">' . $subTitle1 . '</div>
<h4 class="title-topics">' . Display::returnFontAwesomeIcon('book') . $thematic_info['title'] . '</h4>
<h4 class="title-topics">'.Display::returnFontAwesomeIcon('book').strip_tags($thematic_info['title']).'</h4>
<p class="date">' . Display::returnFontAwesomeIcon('calendar-o') . $thematic_advance_info['start_date'] . '</p>
<div class="views">' . Display::returnFontAwesomeIcon('file-text-o') . strip_tags($thematic_advance_info['content']). '</div>
<p class="time">'. Display::returnFontAwesomeIcon('clock-o') . get_lang('DurationInHours') . ' : ' . $thematic_advance_info['duration'] . ' - <a href="' . $thematicUrl . '">' . get_lang('SeeDetail') . '</a></p>

@ -361,8 +361,8 @@ $_configuration['agenda_legend'] = [
'red' => 'red caption',
'#f0f' => 'another caption'
];*/
// Save question titles with HTML
// $_configuration['question_title_html'] = false;
// Save some tool titles with HTML editor
// $_configuration['save_titles_like_html'] = false;
// Show the full toolbar set to all CKEditor
//$_configuration['full_ckeditor_toolbar_set'] = false;
// Allow change the orientation when export a single (course progress) thematic to pdf. Portrait or landscape

@ -9,20 +9,18 @@
<tbody>
<tr>
<td>
<h2>{{ theme.title }}</h2>
{{ theme.title }}
{{ theme.content }}
</td>
<td>
{% for plan in plans %}
<h3>{{ plan.title }}</h3>
{{ plan.title }}
{{ plan.description }}
{% endfor %}
</td>
<td>
{% for advance in advances %}
<p>
<strong>{{ advance.start_date|api_convert_and_format_date(2) ~ ' (' ~ advance.duration ~ 'HourShort'|get_lang ~ ') ' }}</strong>
</p>
<p>{{ advance.start_date|api_convert_and_format_date(2) ~ ' (' ~ advance.duration ~ 'HourShort'|get_lang ~ ') ' }}</p>
{{ advance.content }}
{% endfor %}
</td>

Loading…
Cancel
Save