class CourseTabs
Public Instance Methods
layout()
click to toggle source
# File Views/Course/Tabs.rb, line 2 def layout @order = 20 @update = true @functions_need = [:courses] gui_vbox :nogroup do show_str :search_txt show_list_single :courses, :flexheight => 1, :callback => true, :width => 100 show_button :search, :delete, :add, :import end gui_window :error do show_html "<h1>You're not allowed to do that</h1>" show_button :close end gui_window :not_all_elements do gui_vbox do gui_vbox :nogroup do show_str :ct_name show_int :ct_duration show_str :ct_desc show_text :ct_contents show_list_drop :ct_filename, 'CourseTypes.files' end gui_vbox :nogroup do show_str :new_room show_str :new_teacher show_str :new_center end show_button :add_missing, :close end end gui_window :add_course do gui_hbox :nogroup do gui_vbox :nogroup do show_entity_courseType_all :new_ctype, :drop, :name show_str :name_date show_entity_person :new_center_course, :drop, :full_name show_button :new_course, :close end end gui_window :win_confirm do show_html :confirm_delete_txt show_button :confirm_delete, :close end end end
rpc_list_choice(session, name, args)
click to toggle source
# File Views/Course/Tabs.rb, line 204 def rpc_list_choice(session, name, args) dputs(3) { "New choice #{name} - #{args.inspect}" } reply(:pass_tabs, ['list_choice', name, args]) + reply(:fade_in, :parent_child) end
rpc_list_choice_sub(session, name, args)
click to toggle source
# File Views/Course/Tabs.rb, line 211 def rpc_list_choice_sub(session, name, args) dputs(3) { "Sub-tab called with #{name}" } end
rpc_update(session)
click to toggle source
# File Views/Course/Tabs.rb, line 54 def rpc_update(session) hide = [] if CourseTypes.data.size > 0 hide.push :ct_name, :ct_duration, :ct_desc, :ct_contents, :ct_filename end if Rooms.data.size > 0 hide.push :new_room end if (teachers = Persons.list_teachers).size > 0 session.owner.permissions if (!session.owner.permissions.index('center')) || teachers.select { |t| t =~ /^#{session.owner.login_name}_/ }.length > 0 hide.push :new_teacher end end if Persons.find_by_permissions(:center) hide.push :new_center end if hide.size < 8 (reply(:window_show, :not_all_elements) + hide.collect { |h| reply(:hide, h) }).flatten else rep = reply(:empty_nonlists, [:courses]) + reply(:update, :courses => Courses.list_courses(session)) if not session.can_view('FlagAdminCourse') rep += reply(:hide, :delete) + reply(:hide, :add) end rep + reply(:hide, :import) + reply(:focus, :search_txt) end end
rpc_update_view(session, args = nil)
click to toggle source
Calls superclass method
# File Views/Course/Tabs.rb, line 215 def rpc_update_view(session, args = nil) super(session, args) + reply(:fade_in, 'parent,windows') + reply(:focus, :search_txt) end