- Timestamp:
- 05/23/08 16:34:29 (6 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid/PyLucid/plugins_internal/back_links/back_links.py
r1584 r1586 35 35 36 36 37 from django.utils.safestring import mark_safe 38 37 39 from PyLucid.system.BasePlugin import PyLucidBasePlugin 38 from PyLucid.models import Page 40 from PyLucid.models import Page, Plugin 39 41 40 42 class back_links(PyLucidBasePlugin): 41 43 42 def lucidTag(self, print_last_page=False, print_index=False, index="Index"):44 def lucidTag(self, **kwargs): 43 45 """ 44 46 generate the backlinks 47 TODO: **kwargs only for Backwards-incompatible changes info 45 48 """ 49 if self.request.debug == True and kwargs != {}: 50 self.page_msg( 51 "DeprecationWarning:" 52 " kwargs in back_links plugin are obsolete. Please remove them." 53 ) 54 return 55 56 # Get the preferences from the database: 57 preferences = self.get_preferences() 58 if preferences == None: 59 # preferences not in database -> reinit required 60 if self.request.debug == True: 61 msg = ( 62 '<a href="http://www.pylucid.org/_goto/121/changes/#23-05-2008-back_links">' 63 'reinit "back_links" plugin required!</a>' 64 ) 65 self.page_msg.red(mark_safe(msg)) 66 return 67 46 68 current_page = self.context["PAGE"] 47 if pr int_last_page== True:69 if preferences["print_last_page"] == True: 48 70 print_page = current_page 49 71 else: … … 53 75 return "" 54 76 55 data = self. backlink_data(print_page)77 data = self._backlink_data(print_page) 56 78 data.reverse() 57 79 58 80 context = { 59 81 "pages": data, 60 "print_index": pr int_index,61 "index": index,82 "print_index": preferences["print_index"], 83 "index": preferences["index"], 62 84 } 63 85 self._render_template("back_links", context)#, debug=True) 64 86 65 def backlink_data(self, parent_page):87 def _backlink_data(self, parent_page): 66 88 """ 67 89 make a list of all pages in the current way back to the index page.
