Changeset 1804

Show
Ignore:
Timestamp:
11/18/08 16:46:22 (16 months ago)
Author:
JensDiemer
Message:

Fixed: multiple additional stylesheets from plugins... ticket:233 http://www.pylucid.org/phpBB2/viewtopic.php?p=1361#1361

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid_project/PyLucid/system/BasePlugin.py

    r1706 r1804  
    145145        page_style.replace_add_data() puts the file links into the page. 
    146146        """ 
     147        def is_added(slug_list, url): 
     148            for entry in slug_list: 
     149                if entry["url"] == url: 
     150                    return True 
     151            return False 
     152             
    147153        for slug in ("js", "css"): 
    148154            url = self.internal_page.get_url(internal_page_name, slug) 
    149155            if url == None: 
    150156                continue 
    151             self.context["%s_data" % slug].append({ 
     157             
     158            slug_list = self.context["%s_data" % slug] 
     159            if is_added(slug_list, url): 
     160                # The same url has been added in the past -> skip 
     161                continue 
     162                         
     163            slug_list.append({ 
    152164                "plugin_name": self.plugin_name, 
    153165                "url": url,