app/controllers/wiki.rb in Pimki-1.1.092 vs app/controllers/wiki.rb in Pimki-1.2.092

- old
+ new

@@ -216,11 +216,11 @@ when 'linkers' web.select { |page| page.wiki_words.size > 0 }.sort_by { |page| page.name } end - if web.menu_limit + if web.menu_limit && @menu_pages @menu_pages = @menu_pages[0..web.menu_limit] end end #}}} def bliki #{{{ @@ -272,21 +272,33 @@ limit = @req.query['limit'].to_i rescue nil limit = 20 unless limit limit -= 1 if limit >= 0 # need to go through the WikiService to persist the command: - wiki.save_menu_pref web, type, limit, content, category + wiki.save_menu_pref web_address, type, limit, content, category end if web_address - redirect_show "HomePage" + # redirect to the most recently viewed page, or the home page. + pname = begin + web.select{ true }.by_last_visited.first.name + rescue + "HomePage" + end + redirect_show pname elsif wiki.webs.length == 1 + # only one web, so go there. redirect_show "HomePage", wiki.webs.values.first.address else redirect_path "/web_list/" end end #}}} + def get_map_img + file_name = "map.png" + file_path = File.join WikiService.storage_path, file_name + send_export(file_name, file_path, "image/png") + end # Within a single page -------------------------------------------------------- def show set_menu_pages \ No newline at end of file