Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/main/portfolio/edit_category.php

40 lines
1.1 KiB

<?php
/* For licensing terms, see /license.txt */
$form = new FormValidator('edit_category', 'post', $baseUrl."action=edit_category&id={$category->getId()}");
$form->addText('title', get_lang('Title'));
$form->addHtmlEditor('description', get_lang('Description'), false, false, ['ToolbarSet' => 'Minimal']);
$form->addButtonUpdate(get_lang('Update'));
$form->setDefaults([
'title' => $category->getTitle(),
'description' => $category->getDescription(),
]);
if ($form->validate()) {
$values = $form->exportValues();
$category
->setTitle($values['title'])
->setDescription($values['description']);
$em->persist($category);
$em->flush();
Display::addFlash(
Display::return_message(get_lang('Updated'), 'success')
);
header("Location: $baseUrl");
exit;
}
$toolName = get_lang('EditCategory');
$interbreadcrumb[] = [
'name' => get_lang('Portfolio'),
'url' => $baseUrl,
];
$actions[] = Display::url(
Display::return_icon('back.png', get_lang('Back'), [], ICON_SIZE_MEDIUM),
$baseUrl
);
$content = $form->returnForm();