    {if isset($T_OP) && $T_OP == 'reset_lesson'}
        {assign var = "title" value = $title|cat:'&nbsp;&raquo;&nbsp;'|cat:'<a class = "titleLink" href ="'|cat:$smarty.server.PHP_SELF|cat:'?ctg=settings&op=reset_lesson">'|cat:$smarty.const._RESTARTLESSON|cat:'</a>'}
    <tr><td class = "moduleCell">
                                    {capture name = 't_reset_lesson_code'}
                                        {$T_RESET_LESSON_FORM.javascript}
                                        <form {$T_RESET_LESSON_FORM.attributes}>
                                            {$T_RESET_LESSON_FORM.hidden}
                                            <table class = "formElements" style = "margin-left:0px">
                                                <tr><td colspan = "100%">{$smarty.const._CHOOSEWHATTODELETE}</td></tr>
                                                <tr><td colspan = "100%">&nbsp;</td></tr>
											{foreach name = "reset_lesson_options" item = "item" key = "key" from = $T_RESET_LESSON_FORM.options}
                                                <tr><td class = "labelCell">{$item.label}:&nbsp;</td>
                                                    <td>{$item.html}</td></tr>
											{/foreach}
                                                <tr><td colspan = "100%">&nbsp;</td></tr>
                                                <tr><td></td><td>{$T_RESET_LESSON_FORM.submit_reset_lesson.html}</td></tr>
                                            </table>
                                        </form>
                                    {/capture}
                                    {eF_template_printInnerTable title = "`$smarty.const._RESTARTLESSON`<span class = 'innerTableName'>&nbsp;&quot;`$T_CURRENT_LESSON->lesson.name`&quot;</span>" data = $smarty.capture.t_reset_lesson_code image = '32x32/refresh.png' main_options = $T_TABLE_OPTIONS}
    </td></tr>

    {elseif isset($T_OP) && $T_OP == 'import_lesson'}
        {assign var = "title" value = $title|cat:'&nbsp;&raquo;&nbsp;'|cat:'<a class = "titleLink" href ="'|cat:$smarty.server.PHP_SELF|cat:'?ctg=settings&op=import_lesson">'|cat:$smarty.const._IMPORTLESSON|cat:'</a>'}
    <tr><td class = "moduleCell">
                                    {capture name = 't_import_lesson_code'}
                                        {$T_IMPORT_LESSON_FORM.javascript}
                                        <form {$T_IMPORT_LESSON_FORM.attributes}>
                                            {$T_IMPORT_LESSON_FORM.hidden}
                                            <table class = "formElements">
                                            	<tr><td colspan = "2">{$smarty.const._RESETLESSONDATA}:</td></tr>
                                                <tr><td colspan = "100%">&nbsp;</td></tr>                                            	
											{foreach name = "reset_lesson_options" item = "item" key = "key" from = $T_IMPORT_LESSON_FORM.options}
                                                <tr><td class = "labelCell">{$item.label}:&nbsp;</td>
                                                    <td>{$item.html}</td></tr>
											{/foreach}
                                                <tr><td colspan = "2">&nbsp;</td></tr>
                                                <tr><td class = "labelCell">{$smarty.const._LESSONDATAFILE}:&nbsp;</td>
                                                    <td>{$T_IMPORT_LESSON_FORM.file_upload.html}</td></tr>
                                                <tr><td></td><td class = "infoCell">{$smarty.const._EACHFILESIZEMUSTBESMALLERTHAN} <b>{$T_MAX_FILESIZE}</b> {$smarty.const._KB}</td></tr>
                                                <tr><td colspan = "2">&nbsp;</td></tr>
                                                <tr><td></td><td>{$T_IMPORT_LESSON_FORM.submit_import_lesson.html}</td></tr>
                                            </table>
                                        </form>
                                    {/capture}
                                    {eF_template_printInnerTable title = "`$smarty.const._IMPORTLESSON`<span class = 'innerTableName'>&nbsp;&quot;`$T_CURRENT_LESSON->lesson.name`&quot;</span>" data = $smarty.capture.t_import_lesson_code image = '32x32/import2.png'  main_options = $T_TABLE_OPTIONS}
    </td></tr>
    {elseif isset($T_OP) && $T_OP == 'export_lesson'}
        {assign var = "title" value = $title|cat:'&nbsp;&raquo;&nbsp;'|cat:'<a class = "titleLink" href ="'|cat:$smarty.server.PHP_SELF|cat:'?ctg=settings&op=export_lesson">'|cat:$smarty.const._EXPORTLESSON|cat:'</a>'}
    <tr><td class = "moduleCell">
                                    {capture name = 't_export_lesson_code'}
                                        <fieldset>
                                        <legend>{$smarty.const._EXPORTLESSON}</legend>
                                        {$T_EXPORT_LESSON_FORM.javascript}
                                        <form {$T_EXPORT_LESSON_FORM.attributes}>
                                            {$T_EXPORT_LESSON_FORM.hidden}
                                            <table class = "formElements" style = "margin-left:0px">                                        {if $T_NEW_EXPORTED_FILE}
                                                <tr><td colspan = "2">{$smarty.const._DOWNLOADEXPORTED}:&nbsp; <a href = "view_file.php?file={$T_NEW_EXPORTED_FILE.id}&action=download">{$T_NEW_EXPORTED_FILE.name}</a> ({$T_NEW_EXPORTED_FILE.size} {$smarty.const.KB}, #filter:timestamp-{$T_NEW_EXPORTED_FILE.timestamp}#)</td></tr>
                                        {elseif $T_EXPORTED_FILE}
                                                <tr><td colspan = "2">{$smarty.const._EXISTINGFILE}:&nbsp;<a href = "view_file.php?file={$T_EXPORTED_FILE.id}&action=download">{$T_EXPORTED_FILE.name}</a> ({$T_EXPORTED_FILE.size} {$smarty.const.KB}, #filter:timestamp-{$T_EXPORTED_FILE.timestamp}#)</td></tr>
                                        {/if}
                                                <tr><td class = "labelCell">{$smarty.const._CLICKTOEXPORT}:&nbsp;</td>
                                                    <td class = "elementCell">{$T_EXPORT_LESSON_FORM.submit_export_lesson.html}</td></tr>
                                            </table>
                                        </form>
                                        </fieldset>
                                    {/capture}
                                    {eF_template_printInnerTable title = "`$smarty.const._EXPORTLESSON`<span class = 'innerTableName'>&nbsp;&quot;`$T_CURRENT_LESSON->lesson.name`&quot;</span>" data = $smarty.capture.t_export_lesson_code image = '32x32/export1.png' main_options = $T_TABLE_OPTIONS}
    </td></tr>
    {elseif isset($T_OP) && $T_OP == 'lesson_users'}
        {assign var = "title" value = $title|cat:'&nbsp;&raquo;&nbsp;'|cat:'<a class = "titleLink" href ="'|cat:$smarty.server.PHP_SELF|cat:'?ctg=settings&op=lesson_users">'|cat:$smarty.const._LESSONUSERS|cat:'</a>'}
    <tr><td class = "moduleCell">

                              {capture name = 't_users_to_lessons_code'}
<!--ajax:usersTable-->
                                                    <table style = "width:100%" class = "sortedTable" size = "{$T_USERS_SIZE}" sortBy = "0" id = "usersTable" useAjax = "1" rowsPerPage = "{$smarty.const.G_DEFAULT_TABLE_SIZE}" url = "{$smarty.server.PHP_SELF}?{$T_BASE_URL}&op=lesson_users&">
                                                        <tr class = "topTitle">
                                                            <td class = "topTitle" name = "login">{$smarty.const._LOGIN}</td>
                                                            <td class = "topTitle" name = "name">{$smarty.const._NAME}</td>
                                                            <td class = "topTitle" name = "surname">{$smarty.const._SURNAME}</td>
                                                            <td class = "topTitle" name = "user_type">{$smarty.const._USERTYPE}</td>
                                                            <td class = "topTitle" name = "role">{$smarty.const._USERROLEINLESSON}</td>
                                                            {if $T_MODULE_HCD_INTERFACE}
                                                            <td class = "topTitle centerAlign">{$smarty.const._OPERATIONS}</td>
                                                            {/if}
                                                            <td class = "topTitle centerAlign" name = "in_lesson">{$smarty.const._STATUS}</td>
                                                        </tr>
                                {foreach name = 'users_to_lessons_list' key = 'key' item = 'user' from = $T_ALL_USERS}
                                                        <tr class = "defaultRowHeight {cycle values = "oddRowColor, evenRowColor"} {if !$user.active}deactivatedTableElement{/if}">
                                                            <td>{$user.login}</td>
                                                            <td>{$user.name}</td>
                                                            <td>{$user.surname}</td>
                                                            <td>{$user.basic_user_type}</td>
                                                            <td>
                                    {if !isset($T_CURRENT_USER->coreAccess.users) || $T_CURRENT_USER->coreAccess.users == 'change'}
                                                                <select name="type_{$user.login}" id = "type_{$user.login}" onchange = "$('checked_{$user.login}').checked=true;ajaxPost('{$user.login}', this);">
                                        {foreach name = 'roles_list' key = 'role_key' item = 'role_item' from = $T_ROLES}
                                                                    <option value="{$role_key}" {if ($user.role == $role_key)}selected{/if}>{$role_item}</option>
                                        {/foreach}
                                                                </select>
                                    {else}
                                                                {$T_ROLES[$user.role]}
                                    {/if}
                                                            </td>
                                                            {if $T_MODULE_HCD_INTERFACE}
                                                            <td align="center">
                                                                <a href = "{$smarty.server.PHP_SELF}?ctg=users&edit_user={$user.login}&add_evaluation=1&popup=1" target = "POPUP_FRAME" onclick = "eF_js_showDivPopup('{$smarty.const._NEWEVALUATION}', new Array('400px', '300px'))">
                                                                    <img src="images/16x16/edit.png" title="{$smarty.const._NEWEVALUATION}" alt="{$smarty.const._NEWEVALUATION}"/ border="0"></a>
                                                                <a href = "{$smarty.server.PHP_SELF}?ctg=evaluations&user={$user.login}">
                                                                    <img src="images/16x16/view.png" title="{$smarty.const._SHOWEVALUATIONS}" alt="{$smarty.const._SHOWEVALUATIONS}"/ border="0"></a>
                                                            </td>
                                                            {/if}
                                                            <td align="center">
                                    {if !isset($T_CURRENT_USER->coreAccess.users) || $T_CURRENT_USER->coreAccess.users == 'change'}
                                                                <input class = "inputCheckbox" type = "checkbox" name = "checked_{$user.login}" id = "checked_{$user.login}" onclick = "ajaxPost('{$user.login}', this);" {if in_array($user.login, $T_LESSON_USERS)}checked = "checked"{/if} />
                                    {else}
                                                                 {if in_array($user.login, $T_LESSON_USERS)}<img src = "images/16x16/check2.png" title = "{$smarty.const._LESSONUSER}" alt = "{$smarty.const._LESSONUSER}" >{/if}
                                    {/if}
                                                            </td>
                                                    </tr>
                                {/foreach}
                                </table>
<!--/ajax:usersTable-->

        {literal}
        <script>
        function ajaxPost(login, el, table_id) {
            var baseUrl =  '{/literal}{$smarty.server.PHP_SELF}{literal}?{/literal}{$T_BASE_URL}{literal}&op=lesson_users&postAjaxRequest=1';
            if (login) {
                var userType = $('type_'+login).options[$('type_'+login).selectedIndex].value;
                var checked  = $('checked_'+login).checked;
                var url      = baseUrl + '&login='+login+'&user_type='+userType;
                var img_id   = 'img_'+login;
            } else if (table_id && table_id == 'usersTable') {
                el.checked ? url = baseUrl + '&addAll=1' : url = baseUrl + '&removeAll=1';
                if ($(table_id+'_currentFilter')) {
                	url = url+'&filter='+$(table_id+'_currentFilter').innerHTML;
                }
                var img_id   = 'img_selectAll';
            }

            var position = eF_js_findPos(el);
            var img      = document.createElement("img");

            img.style.position = 'absolute';
            img.style.top      = Element.positionedOffset(Element.extend(el)).top  + 'px';
            img.style.left     = Element.positionedOffset(Element.extend(el)).left + 6 + Element.getDimensions(Element.extend(el)).width + 'px';

            img.setAttribute("id", img_id);
            img.setAttribute('src', 'images/others/progress1.gif');

            el.parentNode.appendChild(img);

                new Ajax.Request(url, {
                        method:'get',
                        asynchronous:true,
                        onSuccess: function (transport) {
                            img.style.display = 'none';
                            img.setAttribute('src', 'images/16x16/check.png');
                            new Effect.Appear(img_id);
                            window.setTimeout('Effect.Fade("'+img_id+'")', 2500);
                            }
                    });
        }
        </script>
        {/literal}

        {/capture}
                    {eF_template_printInnerTable title = "`$smarty.const._UPDATEUSERSTOLESSONS`<span class = 'innerTableName'>&nbsp;&quot;`$T_CURRENT_LESSON->lesson.name`&quot;</span>" data = $smarty.capture.t_users_to_lessons_code image = '32x32/book_blue_preferences.png' main_options = $T_TABLE_OPTIONS}

    </td></tr>

    {elseif isset($T_OP) && $T_OP == 'lesson_layout'}
        {assign var = "title" value = $title|cat:'&nbsp;&raquo;&nbsp;'|cat:'<a class = "titleLink" href ="'|cat:$smarty.server.PHP_SELF|cat:'?ctg=settings&op=lesson_layout">'|cat:$smarty.const._LAYOUT|cat:'</a>'}
    <tr><td class = "moduleCell">
        {capture name = "t_layout_code"}
            <table style = "margin-left:auto;margin-right:auto">
                <tr><td style = "width:16px">
                    <input type = "submit" value = "{$smarty.const._SAVECHANGES}" onclick = "updatePositions()" class = "flatButton"/>
                </td><td style = "width:16px">
                    <img src = "images/others/progress1.gif" id = "progress_image" alt = "{$smarty.const._LOADING}" title = "{$smarty.const._LOADING}" style = "vertical-align:middle;display:none"/>
                </td></tr>
            </table>
            <br/>


                    {capture name = "layout_moduleContentTree"}
                        <li id = "firstlist_moduleContentTree">
                            <table class = "innerTable" style = "width:300px">
                                <tr class = "handle">
                                    <th class = "innerTableHeader">
                                        <img class = "iconTableImage" src = "images/32x32/book_open.png" alt = "{$smarty.const._CURRENTCONTENT}" title = "{$smarty.const._CURRENTCONTENT}">
                                        {$smarty.const._CURRENTCONTENT}
                                    </th>
                                    <td class = "innerTableHeader" style = "text-align:right"><img src = "images/others/blank.gif" {if isset($T_DEFAULT_POSITIONS.visibility.moduleContentTree) && $T_DEFAULT_POSITIONS.visibility.moduleContentTree == 0}class = "plus"{else}class = "minus"{/if} onclick = "toggleVisibility(Element.extend(this).up().up().next().down(), this);"></td></tr>
                                
                                <tr><td colspan = "2" style = "height:60px;text-align:center;vertical-align:top;{if isset($T_DEFAULT_POSITIONS.visibility.moduleContentTree) && $T_DEFAULT_POSITIONS.visibility.moduleContentTree == 0}display:none;{/if}"><img src = "images/others/content_tree_thumbnail.png"></td></tr>
                            </table>
                        </li>
                    {/capture}
                    {capture name = "layout_moduleProjectsList"}
                        <li id = "firstlist_moduleProjectsList">
                            <table class = "innerTable" style = "width:300px">
                                <tr class = "handle">
                                    <th class = "innerTableHeader">
                                        <img class = "iconTableImage" src = "images/32x32/exercises.png" alt = "{$smarty.const._PROJECTS}" title = "{$smarty.const._PROJECTS}">
                                        {$smarty.const._PROJECTS}
                                    </th>
                                    <td class = "innerTableHeader" style = "text-align:right"><img src = "images/others/blank.gif" {if isset($T_DEFAULT_POSITIONS.visibility.moduleProjectsList) && $T_DEFAULT_POSITIONS.visibility.moduleProjectsList == 0}class = "plus"{else}class = "minus"{/if} onclick = "toggleVisibility(Element.extend(this).up().up().next().down(), this);"></td></tr>
                                
                                <tr><td colspan = "2" style = "height:60px;text-align:center;vertical-align:top;{if isset($T_DEFAULT_POSITIONS.visibility.moduleProjectsList) && $T_DEFAULT_POSITIONS.visibility.moduleProjectsList == 0}display:none;{/if}"><img src = "images/others/projects_thumbnail.png"></td></tr>
                            </table>
                        </li>
                    {/capture}
                    {capture name = "layout_moduleNewsList"}
                        <li id = "secondlist_moduleNewsList">
                            <table class = "innerTable" style = "width:300px">
                                <tr class = "handle">
                                    <th class = "innerTableHeader">
                                        <img class = "iconTableImage" src = "images/32x32/news.png" alt = "{$smarty.const._ANNOUNCEMENTS}" title = "{$smarty.const._ANNOUNCEMENTS}">
                                        {$smarty.const._ANNOUNCEMENTS}
                                    </th>
                                    <td class = "innerTableHeader" style = "text-align:right"><img src = "images/others/blank.gif" {if isset($T_DEFAULT_POSITIONS.visibility.moduleNewsList) && $T_DEFAULT_POSITIONS.visibility.moduleNewsList == 0}class = "plus"{else}class = "minus"{/if} onclick = "toggleVisibility(Element.extend(this).up().up().next().down(), this);"></td></tr>
                                
                                <tr><td colspan = "2" style = "height:60px;text-align:center;vertical-align:top;{if isset($T_DEFAULT_POSITIONS.visibility.moduleNewsList) && $T_DEFAULT_POSITIONS.visibility.moduleNewsList == 0}display:none;{/if}"><img src = "images/others/news_thumbnail.png"></td></tr>
                            </table>
                        </li>
                    {/capture}
                    {capture name = "layout_modulePersonalMessagesList"}
                        <li id = "secondlist_modulePersonalMessagesList">
                            <table class = "innerTable" style = "width:300px">
                                <tr class = "handle">
                                    <th class = "innerTableHeader">
                                        <img class = "iconTableImage" src = "images/32x32/mail2.png" alt = "{$smarty.const._PERSONALMESSAGES}" title = "{$smarty.const._PERSONALMESSAGES}">
                                        {$smarty.const._PERSONALMESSAGES}
                                    </th>
                                    <td class = "innerTableHeader" style = "text-align:right"><img src = "images/others/blank.gif" {if isset($T_DEFAULT_POSITIONS.visibility.modulePersonalMessagesList) && $T_DEFAULT_POSITIONS.visibility.modulePersonalMessagesList == 0}class = "plus"{else}class = "minus"{/if} onclick = "toggleVisibility(Element.extend(this).up().up().next().down(), this);"></td></tr>
                                
                                <tr><td colspan = "2" style = "height:60px;text-align:center;vertical-align:top;{if isset($T_DEFAULT_POSITIONS.visibility.modulePersonalMessagesList) && $T_DEFAULT_POSITIONS.visibility.modulePersonalMessagesList == 0}display:none;{/if}"><img src = "images/others/personal_messages_thumbnail.png"></td></tr>
                            </table>
                        </li>
                    {/capture}
                    {capture name = "layout_moduleForumList"}
                        <li id = "secondlist_moduleForumList">
                            <table class = "innerTable" style = "width:300px">
                                <tr class = "handle">
                                    <th class = "innerTableHeader">
                                        <img class = "iconTableImage" src = "images/32x32/messages.png" alt = "{$smarty.const._RECENTMESSAGESATFORUM}" title = "{$smarty.const._RECENTMESSAGESATFORUM}">
                                        {$smarty.const._RECENTMESSAGESATFORUM}
                                    </th>
                                    <td class = "innerTableHeader" style = "text-align:right"><img src = "images/others/blank.gif" {if isset($T_DEFAULT_POSITIONS.visibility.moduleForumList) && $T_DEFAULT_POSITIONS.visibility.moduleForumList == 0}class = "plus"{else}class = "minus"{/if} onclick = "toggleVisibility(Element.extend(this).up().up().next().down(), this);"></td></tr>
                                
                                <tr><td colspan = "2" style = "height:60px;text-align:center;vertical-align:top;{if isset($T_DEFAULT_POSITIONS.visibility.moduleForumList) && $T_DEFAULT_POSITIONS.visibility.moduleForumList == 0}display:none;{/if}"><img src = "images/others/forum_thumbnail.png"></td></tr>
                            </table>
                        </li>
                    {/capture}
                    {capture name = "layout_moduleComments"}
                        <li id = "secondlist_moduleComments">
                            <table class = "innerTable" style = "width:300px">
                                <tr class = "handle">
                                    <th class = "innerTableHeader">
                                        <img class = "iconTableImage" src = "images/32x32/note.png" alt = "{$smarty.const._COMMENTS}" title = "{$smarty.const._COMMENTS}">
                                        {$smarty.const._COMMENTS}
                                    </th>
                                    <td class = "innerTableHeader" style = "text-align:right"><img src = "images/others/blank.gif" {if isset($T_DEFAULT_POSITIONS.visibility.moduleComments) && $T_DEFAULT_POSITIONS.visibility.moduleComments == 0}class = "plus"{else}class = "minus"{/if} onclick = "toggleVisibility(Element.extend(this).up().up().next().down(), this);"></td></tr>
                                
                                <tr><td colspan = "2" style = "height:60px;text-align:center;vertical-align:top;{if isset($T_DEFAULT_POSITIONS.visibility.moduleComments) && $T_DEFAULT_POSITIONS.visibility.moduleComments == 0}display:none;{/if}"><img src = "images/others/comments_thumbnail.png"></td></tr>
                            </table>
                        </li>
                    {/capture}
                    {capture name = "layout_moduleCalendar"}
                        <li id = "secondlist_moduleCalendar">
                            <table class = "innerTable" style = "width:300px">
                                <tr class = "handle">
                                    <th class = "innerTableHeader">
                                        <img class = "iconTableImage" src = "images/32x32/calendar.png" alt = "{$smarty.const._CALENDAR}" title = "{$smarty.const._CALENDAR}">
                                        {$smarty.const._CALENDAR}
                                    </th>
                                    <td class = "innerTableHeader" style = "text-align:right"><img src = "images/others/blank.gif" {if isset($T_DEFAULT_POSITIONS.visibility.moduleCalendar) && $T_DEFAULT_POSITIONS.visibility.moduleCalendar == 0}class = "plus"{else}class = "minus"{/if} onclick = "toggleVisibility(Element.extend(this).up().up().next().down(), this);"></td></tr>
                                
                                <tr><td colspan = "2" style = "height:60px;text-align:center;vertical-align:top;{if isset($T_DEFAULT_POSITIONS.visibility.moduleCalendar) && $T_DEFAULT_POSITIONS.visibility.moduleCalendar == 0}display:none;{/if}"><img src = "images/others/calendar_thumbnail.png"></td></tr>
                            </table>
                        </li>
                    {/capture}
                    {capture name = "layout_moduleDigitalLibrary"}
                        <li id = "secondlist_moduleDigitalLibrary">
                            <table class = "innerTable" style = "width:300px">
                                <tr class = "handle">
                                    <th class = "innerTableHeader">
                                        <img class = "iconTableImage" src = "images/32x32/folder_view.png" alt = "{$smarty.const._DIGITALLIBRARY}" title = "{$smarty.const._DIGITALLIBRARY}">
                                        {$smarty.const._DIGITALLIBRARY}
                                    </th>
                                    <td class = "innerTableHeader" style = "text-align:right"><img src = "images/others/blank.gif" {if isset($T_DEFAULT_POSITIONS.visibility.moduleDigitalLibrary) && $T_DEFAULT_POSITIONS.visibility.moduleDigitalLibrary == 0}class = "plus"{else}class = "minus"{/if} onclick = "toggleVisibility(Element.extend(this).up().up().next().down(), this);"></td></tr>
                                
                                <tr><td colspan = "2" style = "height:60px;text-align:center;vertical-align:top;{if isset($T_DEFAULT_POSITIONS.visibility.moduleDigitalLibrary) && $T_DEFAULT_POSITIONS.visibility.moduleDigitalLibrary == 0}display:none;{/if}"><img src = "images/others/digital_library_thumbnail.png"></td></tr>
                            </table>
                        </li>
                    {/capture}
                {foreach name = 'lesson_modules_list' item = "module" key = "class_name" from = $T_LESSON_MODULES}
                    {assign var = module_name value = $class_name|replace:"_":""}
                    {capture name = "layout_"|cat:$module_name}
                        <li id = "secondlist_{$class_name|replace:"_":""}">
                            <table class = "innerTable" style = "width:300px">
                                <tr class = "handle">
                                    <th class = "innerTableHeader">
                                        <img class = "iconTableImage" src = "images/32x32/component_green.png" alt = "{$module.title}" title = "{$module.title}">
                                        {$module.title}
                                    </th>
                                    <td class = "innerTableHeader" style = "text-align:right"><img src = "images/others/blank.gif" {if isset($T_DEFAULT_POSITIONS.visibility.$module_name) && $T_DEFAULT_POSITIONS.visibility.$module_name == 0}class = "plus"{else}class = "minus"{/if} onclick = "toggleVisibility(Element.extend(this).up().up().next().down(), this);"></td></tr>
                                
                                <tr><td colspan = "2" style = "height:60px;text-align:center;vertical-align:middle;{if isset($T_DEFAULT_POSITIONS.visibility.$module_name) && $T_DEFAULT_POSITIONS.visibility.$module_name == 0}display:none;{/if}"><img src = "images/16x16/component_green.png" alt = "{$smarty.const._MODULE}" title = "{$smarty.const._MODULE}"></td></tr>
                            </table>
                        </li>
                    {/capture}
                {/foreach}
            <div id = "sortableList" style = "width:602px;margin-left:auto;margin-right:auto;">
                <div style = "float:left; width:290px">
                    <ul class = "sortable" id = "firstlist" style = "width:100%">
                    {if !in_array('moduleContentTree', $T_DEFAULT_POSITIONS.first) && !in_array('moduleContentTree', $T_DEFAULT_POSITIONS.second)}{$smarty.capture.layout_moduleContentTree}{/if}
                    {if !in_array('moduleProjectsList', $T_DEFAULT_POSITIONS.first) && !in_array('moduleProjectsList', $T_DEFAULT_POSITIONS.second)}{$smarty.capture.layout_moduleProjectsList}{/if}

                    {foreach name = positions_first key = "key" item = "innerTable" from = $T_DEFAULT_POSITIONS.first}
                        {if !$T_INVALID_OPTIONS.$innerTable}
                            {assign var = "capture_name" value = "layout_"|cat:$innerTable}
                            {$smarty.capture.$capture_name}
                        {/if}
                    {/foreach}
                    </ul>
                </div>
                <div style="float:right; width:290px">
                    <ul class = "sortable" id = "secondlist" style = "width:100%">
                    {if !in_array('moduleNewsList', $T_DEFAULT_POSITIONS.first) && !in_array('moduleNewsList', $T_DEFAULT_POSITIONS.second)}{$smarty.capture.layout_moduleNewsList}{/if}
                    {if !in_array('modulePersonalMessagesList', $T_DEFAULT_POSITIONS.first) && !in_array('modulePersonalMessagesList', $T_DEFAULT_POSITIONS.second)}{$smarty.capture.layout_modulePersonalMessagesList}{/if}
                    {if !in_array('moduleForumList', $T_DEFAULT_POSITIONS.first) && !in_array('moduleForumList', $T_DEFAULT_POSITIONS.second)}{$smarty.capture.layout_moduleForumList}{/if}
                    {if !in_array('moduleComments', $T_DEFAULT_POSITIONS.first) && !in_array('moduleComments', $T_DEFAULT_POSITIONS.second)}{$smarty.capture.layout_moduleComments}{/if}
                    {if !in_array('moduleCalendar', $T_DEFAULT_POSITIONS.first) && !in_array('moduleCalendar', $T_DEFAULT_POSITIONS.second)}{$smarty.capture.layout_moduleCalendar}{/if}
                    {if !in_array('moduleDigitalLibrary', $T_DEFAULT_POSITIONS.first) && !in_array('moduleDigitalLibrary', $T_DEFAULT_POSITIONS.second)}{$smarty.capture.layout_moduleDigitalLibrary}{/if}

                    {foreach name = positions_second key = "key" item = "innerTable" from = $T_DEFAULT_POSITIONS.second}
                        {if !$T_INVALID_OPTIONS.$innerTable}
                            {assign var = "capture_name" value = "layout_"|cat:$innerTable}
                            {$smarty.capture.$capture_name}
                        {/if}
                    {/foreach}
                    {foreach name = 'lesson_modules_list' item = "module" key = "class_name" from = $T_LESSON_MODULES}
                        {assign var = module_name value = $class_name|replace:"_":""}
                        {assign var = layout_name value = "layout_"|cat:$module_name}
                        {if !in_array($module_name, $T_DEFAULT_POSITIONS.first) && !in_array($module_name, $T_DEFAULT_POSITIONS.second)}{$smarty.capture.$layout_name}{/if}
                    {/foreach}
                    </ul>
                </div>
            </div>

        <script type = "text/javascript">
        {literal}
            function updatePositions() {
                var str = '';
                $('firstlist').select('li').each(function (s)  {str += 'visibility['+ s.id.replace(/.*_/, '') + ']=' + (s.select('img')[1].className == 'plus' ? 0 : 1) + '&'});
                $('secondlist').select('li').each(function (s) {str += 'visibility['+ s.id.replace(/.*_/, '') + ']=' + (s.select('img')[1].className == 'plus' ? 0 : 1) + '&'});
                str = str.substring(0, str.length - 1); //Remove trailing &
                $('progress_image').setAttribute('src', 'images/others/progress1.gif');
                $('progress_image').show();
                new Ajax.Request('set_positions.php?set_default=1', {
                    method:'post',
                    asynchronous:true,
                    parameters: { firstlist: Sortable.serialize('firstlist'), secondlist: Sortable.serialize('secondlist'), visibility: str },
                    onSuccess: function (transport) {
                        $('progress_image').hide();
                        $('progress_image').setAttribute('src', 'images/16x16/check.png');
                        new Effect.Appear('progress_image');
                        window.setTimeout('Effect.Fade("progress_image")', 2500);
                    }
                });
            }
            Sortable.create("firstlist", {
                containment:["firstlist","secondlist"], constraint:false
            });
            Sortable.create("secondlist", {
                containment:["firstlist", "secondlist"], constraint:false
            });
        {/literal}
        </script>
        {/capture}
        {eF_template_printInnerTable title = "`$smarty.const._LAYOUTFORLESSON`<span class = 'innerTableName'>&nbsp;&quot;`$T_CURRENT_LESSON->lesson.name`&quot;</span>" data = $smarty.capture.t_layout_code image = '32x32/layout_center.png' main_options = $T_TABLE_OPTIONS}
    </td></tr>

    {else}
        {*moduleLessonSettings: Left options list in the Lesson settings page*}
    <tr><td class = "moduleCell">
                                    {eF_template_printIconTable title = "`$smarty.const._OPTIONSFORLESSON`<span class = 'innerTableName'>&nbsp;&quot;`$T_CURRENT_LESSON->lesson.name`&quot;</span>" columns = 4 links = $T_LESSON_SETTINGS image='32x32/book_blue_view.png' options = $T_TABLE_OPTIONS groups = $T_LESSON_SETTINGS_GROUPS}
                                    <script>
                                    {literal}
                                        function activate(el, action) {
                                            var src = Element.down(el).src;
                                            src.match(/_gray/) ? url = '{/literal}{$smarty.server.PHP_SELF}{literal}?{/literal}{$T_BASE_URL}{literal}&ajax=1&activate='+action : url = '{/literal}{$smarty.server.PHP_SELF}{literal}?{/literal}{$T_BASE_URL}{literal}&ajax=1&deactivate='+action;;
                                            Element.down(el).blur();
                                            Element.down(el).setAttribute('src', 'images/others/progress_big.gif');
                                            new Ajax.Request(url, {
                                                    method:'get',
                                                    asynchronous:true,
                                                    onSuccess: function (transport) {
                                                        if (src.match(/_gray/)) {
                                                            Element.down(el).setAttribute('src', src.replace(/_gray/, ''));
                                                            el.setStyle({color:'inherit'});
                                                        } else {
                                                            Element.down(el).setAttribute('src', src.replace(/.png/, '_gray.png'));
                                                            el.setStyle({color:'gray'});
                                                        }
                                                        
                                                        if (parent.sideframe.location.toString().toQueryParams().sbctg) {
                                                        	parent.sideframe.location.reload();
                                                        } else if ('{/literal}{$smarty.session.s_type}{literal}' != 'administrator') {
                                                        	parent.sideframe.location = parent.sideframe.location + '&sbctg=settings';
                                                        }
                                                        
                                                    }
                                                });
                                        }
                                    {/literal}
                                    </script>
    </td></tr>
    {/if}
