Allow save learnpath category with HTML code when save_titles_as_html is enabled - refs BT#12756

pull/2487/head
Angel Fernando Quiroz Campos 8 years ago
parent d13b0e2d27
commit b965163df0
  1. 6
      main/lp/learnpath.class.php
  2. 13
      main/lp/lp_add_category.php
  3. 2
      main/lp/lp_list.php
  4. 2
      main/lp/lp_subscribe_users_to_category.php

@ -4323,7 +4323,7 @@ class learnpath
$tool
->setCategory('authoring')
->setCId($courseId)
->setName($category->getName())
->setName(strip_tags($category->getName()))
->setLink($link)
->setImage('lp_category.gif')
->setVisibility(1)
@ -4346,7 +4346,7 @@ class learnpath
if ($setVisibility == 1 && $tool) {
$tool
->setName($category->getName())
->setName(strip_tags($category->getName()))
->setVisibility(1);
$em->persist($tool);
@ -4412,7 +4412,7 @@ class learnpath
")
->setParameters([
'course' => $courseId,
'name' => $category->getName(),
'name' => strip_tags($category->getName()),
'link' => "$link%"
])
->getResult();

@ -31,8 +31,17 @@ $form = new FormValidator(
$form->addElement('header', null, get_lang('AddLPCategory'));
// Title
$form->addElement('text', 'name', api_ucfirst(get_lang('Name')));
$form->addRule('name', get_lang('ThisFieldIsRequired'), 'required');
if (api_get_configuration_value('save_titles_as_html')) {
$form->addHtmlEditor(
'name',
get_lang('Name'),
true,
false,
['ToolbarSet' => 'Minimal']
);
} else {
$form->addText('name', get_lang('Name'), true);
}
$form->addElement('hidden', 'action', 'add_lp_category');
$form->addElement('hidden', 'c_id', api_get_course_int_id());

@ -151,7 +151,7 @@ if ($filteredCategoryId) {
}
$interbreadcrumb[] = ['name' => $nameTools, 'url' => api_get_self()];
$nameTools = $category->getName();
$nameTools = strip_tags($category->getName());
}
}

@ -36,7 +36,7 @@ $interbreadcrumb[] = array(
'url' => 'lp_controller.php?action=list&'.api_get_cidreq(),
'name' => get_lang('LearningPaths')
);
$interbreadcrumb[] = array('url' => '#', 'name' => $category->getName());
$interbreadcrumb[] = array('url' => '#', 'name' => strip_tags($category->getName()));
// Find course.
$course = $em->getRepository('ChamiloCoreBundle:Course')->find($courseId);

Loading…
Cancel
Save