예제 #1
0
     $content = $form->returnForm();
     if ($form->validate()) {
         $data = $form->getSubmitValues();
         CourseHome::updateTool($id, $data);
         Display::addFlash(Display::return_message(get_lang('Updated')));
         if (isset($data['delete_icon'])) {
             CourseHome::deleteIcon($id);
         }
         $currentUrlReturn = api_get_self() . '?' . api_get_cidreq();
         header('Location: ' . $currentUrlReturn);
         exit;
     }
     break;
 case 'list':
 default:
     $toolList = CourseHome::toolsIconsAction(api_get_course_int_id(), api_get_session_id());
     $iconsTools = '<div id="custom-icons">';
     $iconsTools .= Display::page_header(get_lang('CustomizeIcons'), null, 'h4');
     $iconsTools .= '<div class="row">';
     foreach ($toolList as $tool) {
         $toolIconName = 'Tool' . api_underscore_to_camel_case($tool['name']);
         $toolIconName = isset(${$toolIconName}) ? get_lang($toolIconName) : $tool['name'];
         $iconsTools .= '<div class="col-md-2">';
         $iconsTools .= '<div class="items-tools">';
         if (!empty($tool['custom_icon'])) {
             $image = getCustomWebIconPath() . $tool['custom_icon'];
             $icon = Display::img($image, $toolIconName);
         } else {
             $image = substr($tool['image'], 0, strpos($tool['image'], '.')) . '.png';
             $icon = Display::return_icon($image, $toolIconName, array('id' => 'tool_' . $tool['id']), ICON_SIZE_BIG, false);
         }