Use FormValidator + format code

1.10.x
Julio Montoya 10 years ago
parent 5712d98d2a
commit c86895539f
  1. 1
      main/auth/courses_controller.php
  2. 24
      main/template/default/auth/categories_list.php
  3. 2
      main/template/default/auth/courses_list.php
  4. 7
      main/template/default/auth/layout.php

@ -234,7 +234,6 @@ class CoursesController
$result = $this->model->store_course_category($category_title);
if ($result) {
Display::addFlash(Display::return_message(get_lang('CourseCategoryStored')));
} else {
Display::addFlash(Display::return_message(get_lang('ACourseCategoryWithThisNameAlreadyExists'), 'error'));
}

@ -13,20 +13,20 @@ api_block_anonymous_users();
$stok = Security::get_token();
?>
<!-- Actions: The menu with the different options in cathe course management -->
<div id="actions" class="actions">
&nbsp;<a href="<?php echo api_get_self() ?>?action=sortmycourses"><?php echo Display::return_icon('back.png', get_lang('Back'),'','32'); ?></a>
<a href="<?php echo api_get_self() ?>?action=sortmycourses">
<?php echo Display::return_icon('back.png', get_lang('Back'),'','32'); ?>
</a>
</div>
<?php
if (!empty($message)) { Display::display_confirmation_message($message, false); }
if (!empty($error)) { Display::display_error_message($error, false); }
?>
<form name="create_course_category" method="post" action="<?php echo api_get_self() ?>?action=createcoursecategory">
<input type="hidden" name="sec_token" value="<?php echo $stok ?>">
<input type="text" name="title_course_category" />
<button type="submit" class="save" name="create_course_category"><?php echo get_lang('AddCategory') ?></button>
</form>
$form = new FormValidator(
'create_course_category',
'post',
api_get_self().'?createcoursecategory'
);
$form->addHidden('sec_token', $stok);
$form->addText('title_course_category', get_lang('Name'));
$form->addButtonSave(get_lang('AddCategory'), 'create_course_category');
$form->display();

@ -17,7 +17,7 @@ $courses_without_category = isset($courses_in_category[0]) ? $courses_in_categor
<!-- Actions: The menu with the different options in cathe course management -->
<div id="actions" class="actions">
<?php if ($action != 'createcoursecategory') { ?>
&nbsp;<a href="<?php echo api_get_self(); ?>?action=createcoursecategory"><?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'),'','32'); ?></a>
<a href="<?php echo api_get_self(); ?>?action=createcoursecategory"><?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'),'','32'); ?></a>
<?php } ?>
</div>

@ -2,15 +2,14 @@
/* For licensing terms, see /license.txt */
/**
* Layout (principal view) used for structuring other views
* Layout (principal view) used for structuring other views
* @author Christian Fasanando <christian1827@gmail.com> - Beeznest
* @package chamilo.auth
*/
// Acces rights: anonymous users can't do anything usefull here.
// Access rights: anonymous users can't do anything useful here.
api_block_anonymous_users();
// Header
Display::display_header('');
@ -18,4 +17,4 @@ Display::display_header('');
echo $content;
// Footer
Display::display_footer();
Display::display_footer();

Loading…
Cancel
Save