<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/tasks/eol_site_specific.rake</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,10 +1,10 @@
-Copyright (c) 2009  Marine Biological Laboratory (Encyclopedia of Life)
-
+Copyright (c) 2009 Encyclopedia of Life project (www.eol.org) and the Marine Biological Lab
+  
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
 &quot;Software&quot;), to deal in the Software without restriction, including
 without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
+distribute, sublicense, and/or sell copies of the Software, and to
 permit persons to whom the Software is furnished to do so, subject to
 the following conditions:
 
@@ -14,7 +14,7 @@ included in all copies or substantial portions of the Software.
 THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file</diff>
      <filename>MIT-LICENSE.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,60 +1,106 @@
 = Encyclopedia of Life
+= www.eol.org
 
-== MAINTENANCE
+== INTRODUCTION
 
-To clear cached javascript and stylesheet assets (restart the app to have them re-created).  Note that assets are only combined when
-config.action_controller.perform_caching=true in one of the environment files:
+Welcome the Encyclopedia of Life project.  The bulk of the code needed to run www.eol.org is written in Ruby on Rails and is
+made available to anyone for re-use, repurposing or for improvement.  This is both an ambitious project and an ambitious codebase
+and we are excited to share it with the open source community.  The code has been under development since approximately September 2007,
+but has undergone many revisions and updates from June 2008-December 2008.  There is much work to be done, both in adding new features,
+and in the ongoing process of code refactoring and performance improvements.  If you see something you like, share it with your colleagues
+and friends and reuse it in your own projects.  If you see something you don't like, help us fix it or join the discussion at the 
+&quot;Developers&quot; forum at http://forum.eol.org, or on GitHub or Google Code.
 
-rake tmp:assets:clear
+== LICENSE
 
-= TODO
+The full code base is released under the MIT License.  Details are available in the &quot;LICENSE.txt&quot; file at the root of the code folder.
 
-It's important that you run this rake task periodically:
+== GETTING STARTED
 
-  rake notes:todo
+This is a big Rails project.  Clearly, some of the installation steps below are big and require multiple steps, but if you are currently
+a Rails developer, some are already done (like installing Ruby).  If you are not a Rails developer, we suggest you first
+visit www.rubyonrails.org for more info on getting going first and then return to us when you have your feet wet. 
+The www.eol.org codebase probably shouldn't be the first Rails project you've ever seen.
 
-(This finds all the places in the code where &quot;TODO&quot; is flagged.)
+For seasoned Rails developers, you'll also notice the codebase does some mix and matching --- both restful controllers and regular controllers,
+both ERB and HAML.  We like the restful way of doing things too and plan to move in that direction.  HAML vs ERB is still an open topic 
+for discussion, although we are sticking with ERB until it's settled.
 
-= Installation
+=== INSTALLATION
 
-== REQUIRED GEMS
+To get things up and running, these are the steps you need to take.  If you actually run 
+through this process, please update this list with any changes you notice being necessary!
+
+Note that many of these steps require root access on your machine.  You have been warned and may need to run them as &quot;sudo&quot; on a Mac/Linux
+or as an administrator on Windows (there, I acknowledged the existence of Windows).
+
+== FIRST THINGS FIRST
+
+1. Install Ruby and the Rails framework on your local machine.
+2. Install MySQL on your local machine.
+3. Get the code from the public repository (http://repository.eol.org/eol) or GitHub.
+
+Next continue with the following sections: &quot;SETTING UP THE DATABASES&quot;, &quot;INSTALLING REQUIRED GEMS&quot;, &quot;MAKING SURE IT REALLY WORKS&quot;
+
+=== SETTING UP THE DATABASES
+
+1. Setup config/database.yml
+  a. copy &quot;config/database.sample.yml&quot; to &quot;config/database.yml&quot;
+  b. Create/update the appropriate entries for your development and test environments
+  c. For development purposes, the +demo+, +integration+, and +production+ environments may be removed
+  d. For production purposes, set the &quot;master_database&quot; to the master database for the core rails database
+    and the &quot;master_data_database&quot; to the master database for the data database (see more info below in the
+    &quot;READ/WRITE SPLITTING&quot; topic)
+2. rake db:create:all
+3. rake db:migrate
+4. rake spec:db:fixtures:load       # You need this or the next step will do nothing.
+5. rake denormal:build_random_taxa  # This populates the eolData database with data.
+6. rake db:migrate RAILS_ENV=test7
+7. rake spec:db:fixtures:load RAILS_ENV=test
+8. rake denormal:build_random_taxa RAILS_ENV=test   # If you don't run this one, you will get more failures!
+
+You can also make the bin/recreate_databases script executable, and then run
+./bin/recreate_databases to automatically run all of those tasks above 
+(assuming you are on a Mac or Unix machine).
 
-Gems required on the server for development but NOT deployment (deployment gems should
+=== INSTALLING REQUIRED GEMS
+
+The following gems are required on your local machhine for development but NOT deployment (deployment gems should
 always be frozen into the project):
 	
 	ZenTest, ruby-debug, piston
 
 If you are on a Mac, you will also need ruby-growl. ...Well, if you run autotest, you will.
 
-== TESTING
+Plugins should be frozen into the vendor folder as is the version of Rails the app depends on.
 
-We're using RSpec for our testing (see the spec/ directory).
+To install required gems:
 
-For model tests, you can either use fixtures or ValidModelBuilder.
+- rake gems         # This could give you some errors...
+- rake gems:build   # if there are gems that aren't installed or you got that big error...
+- rake gems:install # if there were gems that are STILL missing...
+- # please manually install gems that are still missing or failed to install.
 
-For controller / view tests, you can do the same - mocks are preferred (especially for view tests).
+=== MAKING SURE IT REALLY WORKS
 
-== INSTALLATION
+- script/server
+- go to http://localhost:3000 and see stuff
 
-To get things up and running, these are the steps you need to take.  If you actually run 
-through this process, please update this list with any changes you notice being necessary!
-
-Note that many of these steps require root access.  You have been warned.
 
-=== GEMS
+== TESTING
 
-- rake gems         # This could throw some big errors.
-- rake gems:build   # if there are gems that aren't installed or you got that big error
-- rake gems:install # if there were gems that are STILL missing...
-- # manually install gems that are still missing or failed to install.
+We're using RSpec for our testing (see the spec/ directory).
+For model tests, you can either use fixtures or ValidModelBuilder.
 
-=== MASTER/SLAVE DATABASES SETUP
+== MULTI-DATABASE AND MASTER/SLAVE DATABASES SETUP
 
 The site is built to allow for master/slave database read/write splitting for the core rails database and
-the &quot;data&quot; database.  There are two plugins involved in the use of multiple databases and read/write splitting:
+the core &quot;data&quot; database.  There are two plugins involved in the use of multiple databases and read/write splitting:
+
  - use_db   -- used to direct some models to a different database (http://rails.elctech.com/blog/using-and-testing-rails-with-multiple-databases)
  - masochism -- used to split read/writes when using ActiveRecord (http://www.planetrubyonrails.org/tags/view/masochism)
 
+=== MULTIPLE DATABASES
 New abstract class models are created which make connections to the other databases required, and then any
 models which need to connect to the other databases are subclassed from the new abstract class.  In our case, 
 we have two abstract classes representing connections to the data database and the logging database:
@@ -67,12 +113,13 @@ These extra two databases are referenced in the database.yml in the following wa
  - environment_data (e.g. development_data)
  - environment_logging (e.g. development_logging)
 
+=== READ/WRITE SPLITTING
 
 Read/write splitting is accomplished with the masochism plugin by adding two new database connections to the
 database.yml file:
 
   - master_database (the master database connection for the core rails database)
-  - master_data_database (the master database connection for the species data database)
+  - master_data_database (the master database connection for the &quot;data&quot; database)
   
 In addition there are new abstract classes representing a connection to each master database that can be
 used to run direct SQL queries against the masters:
@@ -81,8 +128,6 @@ used to run direct SQL queries against the masters:
   - SpeciesSchemaWriter  (for the species data database)
     
 The logging database does not require read/write splitting since there is only a single server for this purpose.
-When in development, the master_database and master_data_database must point to the same place as development
-and development_data respectively. 
 
 To enable read/write splitting via ActiveRecord, include the following in the approriate environment.rb file (e.g. config/environments/production.rb):
 
@@ -96,35 +141,24 @@ development, which is important to note if you wish to test this functionality i
 
 config.cache_classes = true
 
-
 Manually crafted SQL queries with SELECT statement will be redirected to slave while all other queries like in the following example will be redirected to master:
 
 SpeciesSchemaModel.connection.execute(&quot;DELETE FROM data_objects WHERE id in (#{data_objects})&quot;)
 
 You don't have to worry about master/slave databases in development mode unless you want to test your code against splitting queries.
+When in development, you could make the master_database and master_data_database must point to the same place as development
+and development_data respectively.  Things should work even if these entries are left out (since the master databases are only 
+connected in a configuration entry in the production environment) but it doesn't hurt if they are there.
 
-=== DATABASES
-
-- Setup MySQL. 
-- Setup config/database.yml
-  - cp config/database.sample.yml config/database.yml
-  - Create the appropriate entries for your development and test environments
-  - For development purposes, the +demo+, +integration+, and +production+ environments may be removed
-  - For production purposes, set the &quot;master_database&quot; to the master database for the core rails database
-    and the &quot;master_data_database&quot; to the master database for the data database
-- rake db:create:all
-- rake db:migrate
-- rake spec:db:fixtures:load       # You need this or the next step will do nothing.
-- rake denormal:build_random_taxa  # This populates the eolData database with data.
-- rake db:migrate RAILS_ENV=test
-- rake spec:db:fixtures:load RAILS_ENV=test
-- rake denormal:build_random_taxa RAILS_ENV=test   # If you don't run this one, you will get more failures!
+== FINDING THINGS TODO
 
-You can also make the bin/recreate_databases script executable, and then run
-./bin/recreate_databases to automatically run all of those tasks above 
-(assuming you are on a Mac or Unix machine).
+Spots in the code requiring some attention for refactoring, cleanup or further work are marked with a &quot;TODO&quot; comment
+and sometimes with a level of priority.  You can quickly locate all these comments with your IDE, an app like TextMate,
+or with a rake command:
 
-=== USERS/ROLES/RIGHTS
+rake notes:todo
+
+== USERS/ROLES/RIGHTS
 
 The site is using the acl_system plugin (http://brainspl.at/articles/2006/02/20/new-plugin-acl_system),
 with the additions of &quot;rights&quot; at a controller level.  Basically:
@@ -164,7 +198,7 @@ actually viewable because this user does not have rights to view it.
 
 e.g. &lt;% restrict_to &quot;(Administrator) &amp; !blacklist&quot; do %&gt; admin stuff here &lt;% end %&gt;
 
-=== ADMINISTRATIVE SECTION
+== ADMINISTRATIVE SECTION
 
 The admin section uses the roles setup described above.  To create a new admin function:
 
@@ -187,7 +221,7 @@ See the existing links for restricting the display of menu items to the specific
 
 7. Make sure you've got at least one admin user with access to the correct role, log in and test.
 
-=== LOGGING
+== LOGGING
 
 The logging model is intended to be thought of as a data mining system. A separate database is used to store all log data, which
 must be defined in your config/database.yml file. (See sample file for naming.) Models and operations tend to fall into two
@@ -220,7 +254,7 @@ for cron jobs, you'll likely want to log all facts for a particular date range:
  - rake logging:fact:yesterday
  - rake logging:fact:range FROM='01/15/2007' TO='12/19/2008'
 
-=== EXTERNAL LINK TRACKING
+== EXTERNAL LINK TRACKING
 
 Any links to external sites that need to be tracked should use the following two helpers:
 
@@ -241,21 +275,25 @@ For images, the following parameters can also be passed:
 
 Currently no reports are provided for external link tracking, all links are stored in the &quot;external_link_logs&quot; in the logging database for later reporting.
 
-=== FRAGMENT CACHING
+== FRAGMENT CACHING
 
-Fragment caching is enabled in the specific environment file (e.g. config/production.rb) and the storage mechanism is set in the
-config/environment.rb file.
+Fragment caching is enabled in the specific environment file (e.g. config/production.rb) and the storage mechanism (i.e. memcached)
+must be se as well.
 
-For memcahed:   config.cache_store = :mem_cache_store, '10.19.19.15:11211', '10.19.19.18:11211'
+For memcahed:   config.cache_store = :mem_cache_store, '10.0.0.1:11211', '10.0.0.2:11211'
 To enable caching: config.action_controller.perform_caching             = true
 
 All &quot;static&quot; pages coming out of the CMS are fragment cached and cleared each hour (or as set in the $CACHE_CLEAR_IN_HOURS value set in
 the config/environment.rb file), using language as key to enable multiple fragments.  The header and footer navigation of each page is also 
-fragment cached on cleared at the same time interval.  When changes are made in the admin interface, these caches are automatically cleared.
+fragment cached on cleared at the same time interval.  The entire home page is cached, also autocleared on the interval set.
+When changes are made in the admin interface, these caches are automatically cleared.
 
 Names searches are cached by query type, language and vetted/non-vetted status.
 
-Species pages are cached using the following attributes as keys (since each will cause a different species page to be created):
+Species pages are cached using the following attributes as keys (since each will cause a different species page to be created).
+Note that when logged in an administrator or content partner, the pages are not cached and are generated dynamically each time.
+
+Variables for naming species page fragment caches:
 - taxon_id
 - language
 - expertise level
@@ -267,23 +305,25 @@ Species page caches can be cleared by taxon ID by a CMS Site Administrator by lo
 Clearing a species page cache automatically clears all of its ancestors as well.
 
 The following URLs can be used to trigger page expiration either manually in the browser or via a web service call.  They only work if called
-from &quot;allowed&quot; IPs (i.e. internal to MBL/EOL) as defined in the application level method &quot;allowed_request&quot; (which returns TRUE or FALSE).
+from &quot;allowed&quot; IPs (i.e. as specified in configuration) as defined in the application level method &quot;allowed_request&quot; (which returns TRUE or FALSE).
 
 /expire_all    == expire all non-species pages
 /expire_taxon/TAXON_ID  == expire specified taxon ID (and it's ancestors)
 /expire_taxa/?taxa_ids=ID1,ID2,ID3 == will expire a list of taxon IDs (and their unique ancestors) specified in the querystring (or post) parameter &quot;taxa_ids&quot; (separate by commas)
+/clear_caches == expire all fragment caches (if supported by data store mechanism)
 
 From within the Rails applications, use the following application level methods:
 
 expire_all   == expire all non-species pages
 expire_taxon(taxon_ID)  == expire specified taxon id and ancestors (unless :expire_ancestors=&gt;false is set)
 expire_taxa(taxon_ID_array) == expire specified array of taxon ID and unique ancestors (unless :expire_ancestors=&gt;false is set)
+clear_all_caches == expire all fragment caches (everything!)
 
 For testing purposes:
 To install memcached on a Mac: http://readystate4.com/2008/08/19/installing-memcached-on-os-x-1054-leopard/
-If you have a local memcached server installed on your laptop, start it with: &quot;memcached -d -m 24 -p 11211&quot; and stop it with &quot;killall memcached&quot;
+If you have a local memcached server installed on your Mac, start it with: &quot;memcached -d -m 24 -p 11211&quot; and stop it with &quot;killall memcached&quot;
 
-=== ASSETT PACKAGER (CSS and JS)
+== ASSETT PACKAGER (CSS and JS)
 
 This is now using a plugin, see details at http://synthesis.sbecker.net/pages/asset_packager
 
@@ -297,18 +337,10 @@ To update/create the combined versions:
 
 rake asset:packager:build_all
 
-To update Capistrano scripts to do this automatically after a deploy:
+In production, this rake command is run as part of the deploy.
 
-namespace :deploy do
- desc &quot;Create asset packages for production&quot; 
- task :after_update_code, :roles =&gt; [:web] do
-   run &lt;&lt;-EOF
-     cd #{release_path} &amp;&amp; rake RAILS_ENV=production asset:packager:build_all
-   EOF
- end
-end
+== TAXONCONCEPT ATTRIBUTION NOTES
 
-=== TaxonConcept ATTRIBUTION Notes
 To get attribution for a given taxon concept ID:
  1. Get TaxonConcept
     e.g. t=TaxonConcept.find(101)
@@ -323,10 +355,3 @@ To get attribution for a given taxon concept ID:
  4. Look at the associated agents for the hierarchy_entry
      e.g. agents=he[0].agents   OR  agents=he.agents
           agents.each {|agent| puts agent.full_name + &quot; &quot; + agent.homepage + &quot; &quot; + agent.logo_cache_url}
-
-
-=== MAKE SURE IT REALLY WORKS
-
-- rake spec           # This takes a long time... several minutes, at this point.  Sorry.  It's all the fixtures.
-- script/server start
-- # test it out.  ;)</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -31,7 +31,7 @@ class ApplicationController &lt; ActionController::Base
   helper :all
   
   helper_method :format_date,:format_date_time,:logged_in?, :current_user, :get_image_url, :get_first_agent, :return_to_url, :current_url
-  helper_method :is_user_in_role?, :is_user_admin?, :convert_to_nbsp,:remove_html,:get_video_url, :get_agent_icons, :hh
+  helper_method :is_user_in_role?, :is_user_admin?, :convert_to_nbsp,:remove_html,:get_video_url,:get_agents, :get_agent_icons, :hh
   helper_method :current_agent, :agent_logged_in?, :truncate, :allow_page_to_be_cached?
   around_filter :set_current_language
     
@@ -99,6 +99,42 @@ end
     !(agent_logged_in? || current_user.is_admin?) # if a content partner or admin is logged in, we do *not* want the page to be cached
   end
 
+  # given a hash containing an agent node, return a comma delimited list of hyperlinked agents
+  # if :linked=&gt;false, only the agents are returned even if links are available
+  # if :only_first=&gt;true, only the first agent is returned even if there are multiple
+  # if :show_link_icon=&gt;false, then the external link icons are not shown for any links that are made
+  def get_agents(data,params={})
+    
+     linked=params[:linked]
+     linked = true if linked.nil?
+     only_first=params[:only_first]
+     only_first = false if only_first.nil?
+      show_link_icon=params[:show_link_icon]
+      show_link_icon=true if show_link_icon.nil?
+    
+     if data.nil? == false &amp;&amp; data['agent'].nil? == false
+        data=EOLConvert.convert_to_hashed_array(data['agent'])
+        agent_list=&quot;&quot;
+        agent_counter=0
+        number_of_agents=data.size
+        for agent in data
+          agent_counter+=1
+          if linked
+            agent_list+=eol_return_linked_text(agent['agentName'],agent['agentHomepage'],:show_link_icon=&gt;show_link_icon) + &quot;, &quot;
+          else
+            agent_list+=agent['agentName'] + &quot;, &quot;
+          end
+          break if only_first
+        end
+        agent_list.strip!.chop!
+        agent_list+=&quot;, et al.&quot; if only_first &amp;&amp; number_of_agents &gt; 1
+        return agent_list
+     else
+        return ''
+     end
+
+  end
+
   # given a hash containing an agent node, returns a list of hyperlinked &lt;img&gt; tag icons
   # if :linked=&gt;false, only the agent icons are returned even if links are available
   # if :normal_icon=&gt;true the then normal sized icon is returned, otherwise the small version is returned</diff>
      <filename>app/controllers/application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,11 +16,30 @@ module ApplicationHelper
     end
     false
   end
+  
+  def eol_return_linked_text(text,link=&quot;&quot;,params={})
+    params[:show_only_if_linked] ||= false              
+    result=&quot;&quot;
+    return &quot;&quot; if (link.blank? || text.blank?) &amp;&amp; params[:show_only_if_linked]  # we don't have a URL and we are asked not to show the text, we won't
+    return text if link.blank?
+    # if we have a link, show it
+    result+=create_external_link(text,link,params) unless link.blank?
+    return result
+  end
 
+  def create_external_link(text,link,params)
+     params[:new_window] ||= true 
+     params[:show_link_icon] ||= true
+     result='&lt;a onclick=&quot;JavaScript:external_link(\'' + CGI::escape(link) + '\',' + params[:new_window].to_s + ',' + $USE_EXTERNAL_LINK_POPUPS.to_s + ');return false;&quot; href=&quot;'+link+'&quot;&gt;' + h(text)
+     result+=&quot; &quot; + external_link_icon if params[:show_link_icon]
+     result.strip + '&lt;/a&gt;'
+  end
+    
   def external_link_icon
-    image_tag('external_link.png',{:alt =&gt; 'external link', :title =&gt; 'external link'})
+    &quot;&lt;img alt=\&quot;external link\&quot; title=\&quot;external link\&quot; src=\&quot;/images/external_link.png\&quot; /&gt;&quot;
   end
 
+
   def taxon_concept_comments_path(taxon_concept)
     return &quot;/taxon_concepts/#{taxon_concept.id}/comments/&quot;
   end
@@ -200,20 +219,62 @@ module ApplicationHelper
     return logo_str
   end
 
-  def external_link_to(*args, &amp;block)
-    #return text of link is blank
-    return args[0] if args[1]==nil || args[1].blank?
+  ## Pass in text and an optional link, if the link is not blank or nil, you will
+  ## get an HTML &lt;a href&gt; tag linked to the url
+  ##  if the link is blank or nil, the text itself is returned
+  ##   this is used for creating the attribution links where we don't know if a URL exists or not
+  ## if :new_window=&gt;false is passed, links are sent to new window (defaults to true)
+  ## if :show_only_if_link=&gt;true is passed, no text is returned if there is no link present (defaults to false)
+  ## if :show_link_icon=&gt;true, then the external link icons are shown for any links that are made (defaults to true)
+  
+  def eol_return_linked_text(text,link=&quot;&quot;,params={})
 
-    html_options = args[2] || {}
-    html_options[:class] ||= ''
-    html_options[:class] += ' external_link'
-    html_options[:class] += ' external_link_popup' if $USE_EXTERNAL_LINK_POPUPS
+    params[:show_only_if_linked] ||= false              
+    result=&quot;&quot;
 
-    if html_options[:show_link_icon].nil? || html_options.delete(:show_link_icon) == true
-      args[0] += &quot; #{external_link_icon}&quot;
+    return &quot;&quot; if (link.blank? || text.blank?) &amp;&amp; params[:show_only_if_linked]  # we don't have a URL and we are asked not to show the text, we won't
+    
+    return text if link.blank?
+    # if we have a link, show it
+    result+=create_external_link(text,link,params) unless link.blank?
+   
+    return result
+    
+  end
+
+  ## Pass in image url and an optional link, if the link is not blank or nil, you will
+  ## get an HTML &lt;a href&gt; image tag linked to the url
+  ##  if the link is blank or nil, an image tag itself is returned
+  ##   this is used for creating the attribution image links where we don't know if a URL exists or not
+  ## if :new_window=&gt;true is passed, links are sent to new window (defaults to true)
+  ## if :show_only_if_link=&gt;true is passed, no image is returned if there is no link present (defaults to false)
+  ## if :alt=&gt;'value' is passed, then the alt tag is set with the value passed
+  ## if :title=&gt;'value' is passed, then the title tag is set with the value passed
+  def eol_return_linked_image(image,link=&quot;&quot;,params={})
+
+    params[:new_window] = true if params[:new_window].nil?
+    params[:show_only_if_linked] ||= false    
+    params[:show_link_icon] ||= false      
+    alt=params[:alt] || &quot;&quot;
+    title=params[:title] || &quot;&quot;
+    result=&quot;&quot;
+
+    return &quot;&quot; if link.blank? &amp;&amp; params[:show_only_if_linked]  # we don't have a URL and we are asked not to show the text, we won't
+    
+    result+='&lt;a onclick=&quot;JavaScript:external_link(\'' + CGI::escape(link) + '\',' + params[:new_window].to_s + ',' + $USE_EXTERNAL_LINK_POPUPS.to_s + ');return false;&quot; href=&quot;'+link+'&quot;&gt;' unless link.blank?
+    
+    unless image.blank?
+      result+=&quot;&lt;img src=\&quot;&quot; + image + &quot;\&quot;&quot; 
+      result+=&quot; alt=\&quot;&quot; + alt + &quot;\&quot; title=\&quot;&quot; + title + &quot;\&quot; /&gt;&quot;
+      result+=&quot;&lt;/a&gt;&quot; unless link.blank? 
     end
-    link_to(args[0],args[1],html_options, &amp;block)
+
+    result+=&quot; &quot; + external_link_icon if params[:show_link_icon]    
+    return result
+    
   end
+  
+
 
   def linked_name(taxon, link_name_string = '', new_window = false)
     return_html=&quot;&quot;</diff>
      <filename>app/helpers/application_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,6 +8,10 @@ module TaxaHelper
             :id =&gt; &quot;large-image-#{which}-button-popup-link&quot;, :class =&gt; 'popup-link', :style =&gt; 'display:none;'
   end
   
+  def link_text(text,link=&quot;&quot;,params={})
+    eol_return_linked_text(text,link,params)
+  end
+    
   def agent_partial(original_agents, params={})
     return '' if original_agents.nil? or original_agents.blank?
     # I am going to cache values (in memory), since there is often a LOT of repetition, here.
@@ -20,7 +24,7 @@ module TaxaHelper
     agents = [agents] unless agents.class == Array # Allows us to pass in a single agent, if needed.
     agents = [agents[0]] if params[:only_first]
     agent_list = agents.collect do |agent|
-      params[:linked] ? external_link_to(hh(agent.full_name), agent.homepage, {:show_link_icon =&gt; params[:show_link_icon]}) : hh(agent.full_name)
+      params[:linked] ? link_text(hh(agent.full_name), agent.homepage, :show_link_icon =&gt; params[:show_link_icon]).strip : hh(agent.full_name)        
     end.join(', ') # I know this looks awkward, but I'm making it more readable.  : )
     agent_list += ', et al.' if params[:only_first] and original_agents.length &gt; 1
     return agent_list
@@ -57,7 +61,7 @@ module TaxaHelper
         else
           if params[:linked] and not url.blank?
             text = agent_logo(agent,logo_size,params)
-            output_html &lt;&lt; external_link_to(text,url,{:show_link_icon =&gt; false})
+            output_html &lt;&lt; '&lt;a onclick=&quot;JavaScript:external_link(\'' + CGI::escape(url) + '\',true,' + $USE_EXTERNAL_LINK_POPUPS.to_s + ');return false;&quot; href=&quot;#&quot;&gt;' + text + '&lt;/a&gt;'          
           else
             output_html &lt;&lt; agent_logo(agent,logo_size,params)
           end</diff>
      <filename>app/helpers/taxa_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -206,7 +206,7 @@ class Search
     vetted_only = user &amp;&amp; user.vetted
     data_objects.each do |data_object|
       data_object.taxon_concepts.each do |taxon_concept|
-        results &lt;&lt; [taxon_concept,data_object] if (!vetted_only || taxon_concept.vetted_id == Vetted.trusted.id) &amp;&amp; taxon_concept.published==1
+        results &lt;&lt; [taxon_concept,data_object] if (!vetted_only || taxon_concept.vetted_id == Vetted.trusted.id)
       end
     end
 </diff>
      <filename>app/models/search.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,7 +25,7 @@
 							if partner.ready_for_agreement? 
 								column_class=cycle('odd','even')  %&gt;
 						    	&lt;tr&gt;
-						    	  &lt;td width=&quot;25%&quot; class=&quot;&lt;%= column_class %&gt;&quot;&gt;&lt;strong&gt;&lt;%=external_link_to(partner.display_name,partner.homepage,{:show_link_icon =&gt; true})%&gt;&lt;/strong&gt;
+						    	  &lt;td width=&quot;25%&quot; class=&quot;&lt;%= column_class %&gt;&quot;&gt;&lt;strong&gt;&lt;%=eol_return_linked_text(partner.display_name,partner.homepage,:show_link_icon=&gt;true)%&gt;&lt;/strong&gt;
 						    	    &lt;br /&gt;&lt;%= agent_logo(partner,'large') if !partner.logo_cache_url.blank?%&gt;&lt;/td&gt;
 						    	  &lt;td class=&quot;&lt;%= column_class %&gt;&quot;&gt;&lt;%=partner.project_description%&gt;
 						    	    &lt;%if partner.show_mou_on_partner_page? %&gt; &lt;%=link_to(&quot;See #{partner.display_name} agreement&quot;,{:controller=&gt;'content_partner',:action=&gt;'agreement',:id=&gt;partner.id},{:target=&gt;'_blank'})%&gt;.&lt;% end %&gt;</diff>
      <filename>app/views/content/partners.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
 									&lt;td width=&quot;80%&quot;&gt;
 										Authors: &lt;%= current_agent.primary_contact.nil? ? 'Joe Sample' : current_agent.primary_contact.full_name %&gt;&lt;br /&gt;
 										Some rights reserved&lt;br /&gt;
-										Project: &lt;%=external_link_to(current_agent.full_name,current_agent.homepage,:show_link_icon=&gt;true)%&gt;
+										Project: &lt;%=  eol_return_linked_text(current_agent.full_name,current_agent.homepage,:show_link_icon=&gt;true)%&gt;
 									&lt;/td&gt;
 									&lt;td&gt;&lt;%= agent_logo(current_agent,&quot;small&quot;) %&gt;&lt;br/&gt;&lt;%=image_tag('licenses/cc_by_small.png')%&gt;&lt;/td&gt;
 									&lt;td&gt;&lt;/td&gt;</diff>
      <filename>app/views/content_partner/attribution.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -12,7 +12,9 @@
      title = @data_object.object_title.empty? ? '[No title]' : @data_object.object_title
    end 
    license_attribution_html = ''
-   license_attribution_html += external_link_to(image_tag(@data_object.license.small_logo_url, {:alt=&gt;(@data_object.license.title || '')}),@data_object.license.source_url, {:show_link_icon =&gt; false})
+   license_attribution_html += eol_return_linked_image(@data_object.license.small_logo_url,
+                                                       @data_object.license.source_url,
+                                                       :alt=&gt;(@data_object.license.title || ''))
    license_attribution_html += &quot; #{@data_object.license.description}&quot; unless @data_object.license.description.blank? 
    source = ''
    if @data_object.sources.length == 1</diff>
      <filename>app/views/data_objects/_page_title.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -41,10 +41,6 @@
 		  &lt;%= javascript_include_tag 'swfobject' %&gt;
     &lt;% end -%&gt;
 
-    &lt;script language=&quot;javascript&quot;&gt;
-      EOL.USE_EXTERNAL_LINK_POPUPS = &lt;%=$USE_EXTERNAL_LINK_POPUPS%&gt;;
-    &lt;/script&gt;
-
 	&lt;%#= javascript_include_tag 'http://s9.addthis.com/js/widget.php?v=10' %&gt;
 
     &lt;!--[if lt IE 7]&gt;</diff>
      <filename>app/views/layouts/main.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -94,7 +94,7 @@
             = cycle('&lt;/tr&gt;&lt;tr&gt;', '', '', '') 
             %td{:width =&gt; &quot;125&quot;}
               = f.radio_button :license_id, license.id
-              = external_link_to(license.title,license.source_url)
+              = eol_return_linked_text(license.title,license.source_url)
     .form_item
       = f.label :rights_statement, 'Default Rights Statement: '
       = f.text_field :rights_statement, :maxlength=&gt;400, :size=&gt;70 </diff>
      <filename>app/views/resources/_form.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 &lt;table width=&quot;100%&quot; cellspacing=&quot;5&quot; cellpadding=&quot;5&quot; border=&quot;0&quot;&gt;
 	&lt;tr&gt;
-		&lt;td valign=&quot;top&quot;&gt;&lt;%=external_link_to(image_tag(&quot;bhl_logo.gif&quot;),&quot;http://www.biodiversitylibrary.org&quot;,{:show_link_icon =&gt; false})%&gt;&lt;/td&gt;
+		&lt;td valign=&quot;top&quot;&gt;&lt;%=eol_return_linked_image(&quot;/images/bhl_logo.gif&quot;,&quot;http://www.biodiversitylibrary.org&quot;)%&gt;&lt;/td&gt;
 		&lt;td&gt;
 			&lt;span class=&quot;smalltext&quot;&gt;The following bibliography has been generated by automated services.  BHL
 			uses taxonomic intelligence tools to locate, verify, and record
@@ -44,7 +44,7 @@
     &lt;% end
     bhl_page_title = hh(content_item[&quot;publication_title&quot;]) %&gt;
     &lt;a name=&quot;BHL&lt;%=counter.to_s%&gt;&quot; /&gt;
-    &lt;h2&gt;&lt;%=external_link_to(hh(content_item[&quot;publication_title&quot;]),hh(content_item[&quot;publication_url&quot;]))%&gt;&lt;/h2&gt;
+    &lt;h2&gt;&lt;%=link_text(hh(content_item[&quot;publication_title&quot;]),hh(content_item[&quot;publication_url&quot;]))%&gt;&lt;/h2&gt; 
     &lt;span class=&quot;smalltext&quot;&gt;&lt;%=hh(content_item[&quot;publication_details&quot;])%&gt;&lt;/span&gt;
     &lt;table class=&quot;results_table&quot; cellspacing=&quot;0&quot; summary=&quot;Links&quot;&gt;
       &lt;tr&gt;&lt;th&gt;Pages&lt;/th&gt;&lt;/tr&gt;
@@ -54,7 +54,7 @@
       item_name += content_item[&quot;item_year&quot;] + &quot;. &quot; unless content_item[&quot;item_year&quot;] == '' or content_item[&quot;item_year&quot;] == '0'
       item_name +=&quot;Vol. &quot; + content_item[&quot;item_volume&quot;] + &quot;, &quot; unless content_item[&quot;item_volume&quot;] == '' or content_item[&quot;item_volume&quot;] = '0'
       item_name += &quot;Issue &quot; + content_item[&quot;item_issue&quot;] + &quot;, &quot; unless content_item[&quot;item_issue&quot;] == '' or content_item[&quot;item_issue&quot;] = '0'
-      item_name += external_link_to('Page ' + content_item[&quot;item_number&quot;], content_item[&quot;item_url&quot;])%&gt;
+      item_name += link_text('Page ' + content_item[&quot;item_number&quot;], content_item[&quot;item_url&quot;])%&gt;
       &lt;tr&gt;&lt;td class=&quot;&lt;%= column_class %&gt;&quot;&gt;&lt;%=item_name%&gt;&lt;/td&gt;&lt;/tr&gt;
 &lt;% end %&gt;
     &lt;/table&gt;
@@ -64,5 +64,5 @@
 &lt;div class=&quot;divider&quot;&gt;&lt;/div&gt;	
 &lt;div class=&quot;content-attribution-area&quot;&gt;
     &lt;div class=&quot;attribution-header2&quot;&gt;&lt;%= &quot;Source and Additional Information&quot;[] %&gt;&lt;/div&gt;
-	&lt;span class=&quot;source&quot;&gt;Content provided by the &lt;%=external_link_to(&quot;Biodiversity Heritage Library&quot;,&quot;http://www.biodiversitylibrary.org/&quot;)%&gt;&lt;/span&gt;
+	&lt;span class=&quot;source&quot;&gt;Content provided by the &lt;%=link_text(&quot;Biodiversity Heritage Library&quot;,&quot;http://www.biodiversitylibrary.org/&quot;)%&gt;&lt;/span&gt;
 &lt;/div&gt;</diff>
      <filename>app/views/taxa/_content_bhl.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+
 &lt;table class=&quot;results_table&quot; cellspacing=&quot;0&quot; summary=&quot;Links&quot;&gt;
 	&lt;tr&gt;&lt;th&gt;Item&lt;/th&gt;&lt;th&gt;Link&lt;/th&gt;&lt;/tr&gt;
 &lt;%
@@ -5,7 +6,7 @@
 		for content_item in @content[2]
 			column_class=cycle('odd','even') 
 			%&gt;
-			&lt;tr&gt;&lt;td class=&quot;&lt;%= column_class %&gt;&quot;&gt;&lt;%= content_item['title'] %&gt;&lt;/td&gt;&lt;td class=&quot;&lt;%= column_class %&gt;&quot;&gt;&lt;%= external_link_to(&quot;[additional information]&quot;,content_item['link']) %&gt;  &lt;%=external_link_icon%&gt;&lt;/td&gt;&lt;/tr&gt;
+			&lt;tr&gt;&lt;td class=&quot;&lt;%= column_class %&gt;&quot;&gt;&lt;%= content_item['title'] %&gt;&lt;/td&gt;&lt;td class=&quot;&lt;%= column_class %&gt;&quot;&gt;&lt;%= link_text(&quot;[additional information]&quot;,content_item['link']) %&gt;  &lt;%=external_link_icon%&gt;&lt;/td&gt;&lt;/tr&gt;
 		&lt;% end 
   end
 %&gt;
@@ -15,7 +16,7 @@
 &lt;div class=&quot;divider&quot;&gt;&lt;/div&gt;	
 &lt;div class=&quot;content-attribution-area&quot;&gt;
     &lt;div class=&quot;attribution-header2&quot;&gt;&lt;%= &quot;Source and Additional Information&quot;[] %&gt;&lt;/div&gt;
-	&lt;span class=&quot;source&quot;&gt;Links above provided by &lt;%=external_link_to(&quot;uBio&quot;,&quot;http://www.ubio.org&quot;)%&gt;&lt;/span&gt;
+	&lt;span class=&quot;source&quot;&gt;Links above provided by &lt;%=link_text(&quot;uBio&quot;,&quot;http://www.ubio.org&quot;)%&gt;&lt;/span&gt;
 &lt;/div&gt;
 
 </diff>
      <filename>app/views/taxa/_content_links.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,6 @@
 &lt;div class=&quot;divider&quot;&gt;&lt;/div&gt;	
 &lt;div class=&quot;content-attribution-area&quot;&gt;
     &lt;div class=&quot;attribution-header2&quot;&gt;&lt;%= &quot;Source and Additional Information&quot;[] %&gt;&lt;/div&gt;
-	&lt;span class=&quot;source&quot;&gt;Names provided by &lt;%=external_link_to(&quot;uBio&quot;,&quot;http://www.ubio.org&quot;) %&gt;&lt;/span&gt;
+	&lt;span class=&quot;source&quot;&gt;Names provided by &lt;%=link_text (&quot;uBio&quot;,&quot;http://www.ubio.org&quot;) %&gt;&lt;/span&gt;
 &lt;/div&gt;
 </diff>
      <filename>app/views/taxa/_content_names.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -9,17 +9,7 @@
 		for project in @content[:projects]
 			column_class=cycle('odd','even') 
 			%&gt;
-			&lt;tr&gt;
-        &lt;td width=&quot;125&quot; height=&quot;110&quot; class=&quot;&lt;%= column_class %&gt;&quot;&gt;
-          &lt;%=external_link_to(image_tag(&quot;collection_icons/#{project[&quot;icon&quot;]}&quot;, {:alt =&gt; &quot;Link to #{project[&quot;agent_name&quot;]}&quot;}), project[&quot;url&quot;], {:show_link_icon =&gt; false})%&gt;
-          &lt;br /&gt;
-          &lt;br /&gt;
-          &lt;%=external_link_to(&quot;project homepage&quot;[],project[&quot;collection_link&quot;],:show_link_icon=&gt;true)%&gt;
-        &lt;/td&gt;
-        &lt;td class=&quot;&lt;%= column_class %&gt;&quot;&gt;
-          &lt;%=external_link_to(project[&quot;collection_title&quot;],project[&quot;url&quot;],:show_link_icon=&gt;true)%&gt;
-        &lt;/td&gt;
-      &lt;/tr&gt;
+			&lt;tr&gt;&lt;td width=&quot;125&quot; height=&quot;110&quot; class=&quot;&lt;%= column_class %&gt;&quot;&gt;&lt;%=eol_return_linked_image(&quot;/images/collection_icons/#{project[&quot;icon&quot;]}&quot;,project[&quot;url&quot;], :alt =&gt; &quot;Link to #{project[&quot;agent_name&quot;]}&quot;)%&gt;&lt;br /&gt;&lt;br /&gt;&lt;%=link_text(&quot;project homepage&quot;[],project[&quot;collection_link&quot;],:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;td class=&quot;&lt;%= column_class %&gt;&quot;&gt;&lt;%=link_text(project[&quot;collection_title&quot;],project[&quot;url&quot;],:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;/tr&gt;
 		&lt;% end 
   end
 %&gt;</diff>
      <filename>app/views/taxa/_content_other_projects.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -12,12 +12,12 @@
   &lt;div class=&quot;unvetted-background-text&quot; id=&quot;links&quot;&gt;
     &lt;table cellspacing=&quot;0&quot; summary=&quot;Links&quot; class=&quot;results_table&quot;&gt;
       &lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Item&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
-      &lt;tr&gt;&lt;td width=&quot;100&quot; height=&quot;60&quot; class=&quot;odd&quot;&gt;&lt;%=external_link_to(image_tag('agent_icons/google.gif'),'http://www.google.com/search?q='+blind_outlink_parameter,{:show_link_icon =&gt; false})%&gt;&lt;/td&gt;&lt;td class=&quot;odd&quot;&gt;&lt;%=external_link_to(&quot;Google&quot;,&quot;http://www.google.com/search?q=&quot;+blind_outlink_parameter,:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;/tr&gt;
-      &lt;tr&gt;&lt;td width=&quot;100&quot; height=&quot;60&quot; class=&quot;even&quot;&gt;&lt;%=external_link_to(image_tag('agent_icons/google.gif'),'http://images.google.com/images?q='+blind_outlink_parameter,{:show_link_icon =&gt; false})%&gt;&lt;/td&gt;&lt;td class=&quot;even&quot;&gt;&lt;%=external_link_to(&quot;Google Images&quot;,&quot;http://images.google.com/search?q=&quot;+blind_outlink_parameter,:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;/tr&gt;
-      &lt;tr&gt;&lt;td width=&quot;100&quot; height=&quot;60&quot; class=&quot;odd&quot;&gt;&lt;%=external_link_to(image_tag('agent_icons/google.gif'),'http://scholar.google.com/scholar?q='+blind_outlink_parameter,{:show_link_icon =&gt; false})%&gt;&lt;/td&gt;&lt;td class=&quot;odd&quot;&gt;&lt;%=external_link_to(&quot;Google Scholar&quot;,&quot;http://scholar.google.com/scholar?q=&quot;+blind_outlink_parameter,:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;/tr&gt;
-      &lt;tr&gt;&lt;td width=&quot;100&quot; height=&quot;60&quot; class=&quot;even&quot;&gt;&lt;%=external_link_to(image_tag('agent_icons/yahoo.gif'),'http://search.yahoo.com/search?p='+blind_outlink_parameter,{:show_link_icon =&gt; false})%&gt;&lt;/td&gt;&lt;td class=&quot;even&quot;&gt;&lt;%=external_link_to(&quot;Yahoo&quot;,&quot;http://search.yahoo.com/search?p=&quot;+blind_outlink_parameter,:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;/tr&gt;
-      &lt;tr&gt;&lt;td width=&quot;100&quot; height=&quot;60&quot; class=&quot;odd&quot;&gt;&lt;%=external_link_to(image_tag('agent_icons/yahoo.gif'),'http://images.search.yahoo.com/search/images?p='+blind_outlink_parameter,{:show_link_icon =&gt; false})%&gt;&lt;/td&gt;&lt;td class=&quot;odd&quot;&gt;&lt;%=external_link_to(&quot;Yahoo Images&quot;,&quot;http://images.search.yahoo.com/search/images?p=&quot;+blind_outlink_parameter,:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;/tr&gt;
-      &lt;tr&gt;&lt;td width=&quot;100&quot; height=&quot;60&quot; class=&quot;even&quot;&gt;&lt;%=external_link_to(image_tag('agent_icons/vivisimo.gif'),'http://vivisimo.com/vivisimo/cgi-bin/query-meta?query='+blind_outlink_parameter,{:show_link_icon =&gt; false})%&gt;&lt;/td&gt;&lt;td class=&quot;even&quot;&gt;&lt;%=external_link_to(&quot;Vivisimo&quot;,&quot;http://vivisimo.com/vivisimo/cgi-bin/query-meta?query=&quot;+blind_outlink_parameter,:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;/tr&gt;
+      &lt;tr&gt;&lt;td width=&quot;100&quot; height=&quot;60&quot; class=&quot;odd&quot;&gt;&lt;%=eol_return_linked_image('/images/agent_icons/google.gif','http://www.google.com/search?q='+blind_outlink_parameter)%&gt;&lt;/td&gt;&lt;td class=&quot;odd&quot;&gt;&lt;%=link_text(&quot;Google&quot;,&quot;http://www.google.com/search?q=&quot;+blind_outlink_parameter,:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;/tr&gt;
+      &lt;tr&gt;&lt;td width=&quot;100&quot; height=&quot;60&quot; class=&quot;even&quot;&gt;&lt;%=eol_return_linked_image('/images/agent_icons/google.gif','http://images.google.com/images?q='+blind_outlink_parameter)%&gt;&lt;/td&gt;&lt;td class=&quot;even&quot;&gt;&lt;%=link_text(&quot;Google Images&quot;,&quot;http://images.google.com/search?q=&quot;+blind_outlink_parameter,:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;/tr&gt;
+      &lt;tr&gt;&lt;td width=&quot;100&quot; height=&quot;60&quot; class=&quot;odd&quot;&gt;&lt;%=eol_return_linked_image('/images/agent_icons/google.gif','http://scholar.google.com/scholar?q='+blind_outlink_parameter)%&gt;&lt;/td&gt;&lt;td class=&quot;odd&quot;&gt;&lt;%=link_text(&quot;Google Scholar&quot;,&quot;http://scholar.google.com/scholar?q=&quot;+blind_outlink_parameter,:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;/tr&gt;
+      &lt;tr&gt;&lt;td width=&quot;100&quot; height=&quot;60&quot; class=&quot;even&quot;&gt;&lt;%=eol_return_linked_image('/images/agent_icons/yahoo.gif','http://search.yahoo.com/search?p='+blind_outlink_parameter)%&gt;&lt;/td&gt;&lt;td class=&quot;even&quot;&gt;&lt;%=link_text(&quot;Yahoo&quot;,&quot;http://search.yahoo.com/search?p=&quot;+blind_outlink_parameter,:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;/tr&gt;
+      &lt;tr&gt;&lt;td width=&quot;100&quot; height=&quot;60&quot; class=&quot;odd&quot;&gt;&lt;%=eol_return_linked_image('/images/agent_icons/yahoo.gif','http://images.search.yahoo.com/search/images?p='+blind_outlink_parameter)%&gt;&lt;/td&gt;&lt;td class=&quot;odd&quot;&gt;&lt;%=link_text(&quot;Yahoo Images&quot;,&quot;http://images.search.yahoo.com/search/images?p=&quot;+blind_outlink_parameter,:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;/tr&gt;
+      &lt;tr&gt;&lt;td width=&quot;100&quot; height=&quot;60&quot; class=&quot;even&quot;&gt;&lt;%=eol_return_linked_image('/images/agent_icons/vivisimo.gif','http://vivisimo.com/vivisimo/cgi-bin/query-meta?query='+blind_outlink_parameter)%&gt;&lt;/td&gt;&lt;td class=&quot;even&quot;&gt;&lt;%=link_text(&quot;Vivisimo&quot;,&quot;http://vivisimo.com/vivisimo/cgi-bin/query-meta?query=&quot;+blind_outlink_parameter,:show_link_icon=&gt;true)%&gt;&lt;/td&gt;&lt;/tr&gt;
     &lt;/tbody&gt;
     &lt;/table&gt;
   &lt;/div&gt;</diff>
      <filename>app/views/taxa/_content_search_the_web.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -17,7 +17,7 @@
 &lt;div class=&quot;content-attribution-area&quot;&gt;
   &lt;div class=&quot;attribution-header2&quot;&gt;&lt;%= &quot;Source and Additional Information&quot;[] %&gt;&lt;/div&gt;
 	&lt;span class=&quot;source&quot;&gt;Synonyms provided by 
-  &lt;%=external_link_to (&quot;Species 2000 &amp;amp; ITIS Catalogue of Life: 2008 Annual Checklist&quot;,&quot;http://www.catalogueoflife.org/&quot;) %&gt;
+  &lt;%=link_text (&quot;Species 2000 &amp;amp; ITIS Catalogue of Life: 2008 Annual Checklist&quot;,&quot;http://www.catalogueoflife.org/&quot;) %&gt;
   &lt;/span&gt;
   
 &lt;/div&gt;</diff>
      <filename>app/views/taxa/_content_synonyms.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,16 +1,39 @@
 &lt;% 
-  unvetted_counter=0
-  unvetted_banner_shown=false
-  comments_style=(@ajax_update ? '' : 'display:none;')  # comments start out as hidden on first page load (shown when entire page is loaded, but for ajax updates, show immediately)
+unvetted_counter=0
+unvetted_banner_shown=false
+comments_style=(@ajax_update ? '' : 'display:none;')  # comments start out as hidden on first page load (shown when entire page is loaded, but for ajax updates, show immediately)
  
-  unless @content[:data_objects].nil?
-    for content_item in @content[:data_objects]
-      unvetted_counter+=1 if content_item.vetted_id != Vetted.trusted.id
--%&gt;
+ unless @content[:data_objects].nil?
+  for content_item in @content[:data_objects]
+    
+    unvetted_counter+=1 if content_item.vetted_id != Vetted.trusted.id
+    
+    author_attribution_html = agent_partial(content_item.authors)
+    source_attribution_html = agent_partial(content_item.sources)
+    sources_icons_linked    = agent_icons_partial(content_item.sources)
+
+        # first try and link the source agents to the object link
+    additional_attribution_html = link_text(agent_partial(content_item.sources, :linked=&gt;false),
+                        content_item.object_url,
+                        :show_only_if_linked=&gt;true)
+    additional_attribution_html+= ' ' + external_link_icon unless additional_attribution_html.blank?
+    
+    # if we don't have any direct object link, then we won't have a source link above the text, so next try to get it using the source
+    additional_attribution_html = source_attribution_html unless additional_attribution_html.blank?
+
+        license_attribution_html = ''
+    unless content_item.license.nil?
+      license_attribution_html += content_item.license.description + '&lt;br/&gt;' unless content_item.license.description.blank?
+      license_attribution_html += eol_return_linked_image(content_item.license.small_logo_url,
+                                content_item.license.source_url,
+                                :alt=&gt;(content_item.license.title || ''))  
+    end -%&gt;
+    
     &lt;% if unvetted_counter == 1 &amp;&amp; !unvetted_banner_shown 
        unvetted_banner_shown=true %&gt;
       &lt;%= render :partial=&gt;'/shared/unvetted_text_warning_box' -%&gt;
     &lt;% end %&gt;
+    
     &lt;div class=&quot;content-article&quot;&gt;
       &lt;% if content_item.object_title.blank? == false &amp;&amp; content_item.object_title != @content[:category_name] %&gt;
         &lt;h1&gt;&lt;%= hh(content_item.object_title) %&gt;&lt;/h1&gt;</diff>
      <filename>app/views/taxa/_content_text.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -37,7 +37,7 @@
             &lt;span class=&quot;iucn-status&quot;&gt;
 
                 &lt;% if @taxon.iucn_conservation_status != ''%&gt;
-                     &lt;%= &quot;IUCN Red List Status&quot;[] %&gt;: &lt;span class=&quot;iucn-status-value&quot;&gt;&lt;%=external_link_to(@taxon.iucn_conservation_status,@taxon.iucn_conservation_status_url)%&gt;&lt;/span&gt;
+                     &lt;%= &quot;IUCN Red List Status&quot;[] %&gt;: &lt;span class=&quot;iucn-status-value&quot;&gt;&lt;%= link_text(@taxon.iucn_conservation_status,@taxon.iucn_conservation_status_url) %&gt;&lt;/span&gt;
                 &lt;% else %&gt;
                     &amp;nbsp;
                 &lt;% end %&gt;</diff>
      <filename>app/views/taxa/_show.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -191,8 +191,8 @@ ENV['RECAPTCHA_PRIVATE_KEY'] = ''
 ENV['APP_VERSION'] = ''
 
 # if exception_notify is true, configure below
-ExceptionNotifier.exception_recipients = [] # %w(errors@example.com) email addresses of people to get exception notifications, separated by spaces, blank array if nobody, can also set $EXCEPTION_NOTIFY to false
-ExceptionNotifier.sender_address = %(&quot;EOL Application Error&quot; &lt;no-reply@example.com&gt;)
+ExceptionNotifier.exception_recipients = [] # email addresses of people to get exception notifications, separated by spaces, blank array if nobody, can also set $EXCEPTION_NOTIFY to false
+ExceptionNotifier.sender_address = %(&quot;EOL Application Error&quot; &lt;no-reply@example.comma&gt;)
 ExceptionNotifier.email_prefix = &quot;[EOL] &quot;
 
 require 'extensions'</diff>
      <filename>config/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -91,23 +91,6 @@ Event.addBehavior(
   //clicking map will show attributions
   'img#map:click': function (e) {
     EOL.popup_links['map_attributions'].click();
-  },
-
-  'a.external_link:click':function(e) {
-    e.stop();
-
-    show_popup = false;
-    if (EOL.USE_EXTERNAL_LINK_POPUPS) {
-      var agree = confirm(&quot;The link you have clicked will take you to an external website.  Are you sure you wish to proceed?&quot;);
-    } else {
-      var agree = true;
-    }
-
-    if (agree) {
-      window.open('/external_link?url=' + this.href.escapeHTML());
-    } else {
-      return false ;
-    }
   }
 
   }).merge(EOL.Tagging.Behaviors).merge(EOL.Search.Behaviors).merge(EOL.Curation.Behaviors).toObject()</diff>
      <filename>public/javascripts/application.js</filename>
    </modified>
    <modified>
      <diff>@@ -87,6 +87,7 @@ function eol_update_image(large_image_url, params) {
 // ... this updates abunchof stuff and is pretty disorganized  :(
 //
 function eol_update_credit(params){
+
     // ! FIELD NOTES ! &lt;start&gt; NOTE: this should really be moved into a partial on the server side!
     field_notes_area = '';
 
@@ -103,11 +104,11 @@ function eol_update_credit(params){
       }
     }
     if (params.license_text != '') {
-        field_notes_area += 'COPYRIGHT: ' + params.license_text + '&lt;a href=&quot;' + params.license_link + '&quot; class=&quot;external_link&quot;&gt; &lt;img src=&quot;'  + params.license_logo + '&quot;&gt;&lt;/a&gt;&lt;br /&gt;';
+        field_notes_area += 'COPYRIGHT: ' + params.license_text + '&lt;a href=&quot;' + params.license_link + '&quot; target =&quot;_blank&quot;&gt; &lt;img src=&quot;'  + params.license_logo + '&quot;&gt;&lt;/a&gt;&lt;br /&gt;';
     }
     if (params.data_supplier != '') {
       if (params.data_supplier_url != '') {
-				field_notes_area += 'SUPPLIER: &lt;a href=&quot;'+params.data_supplier_url+'&quot; class=&quot;external_link&quot;&gt;' + params.data_supplier + ' &lt;img alt=&quot;external link&quot; src=&quot;/images/external_link.png&quot;&gt;&lt;/a&gt; ' + params.data_supplier_icon  + '&lt;br /&gt;';
+				field_notes_area += 'SUPPLIER: &lt;a onclick=&quot;JavaScript:external_link(\'' + escape(params.data_supplier_url) + '\',true,false);return false;&quot; href=&quot;#&quot;&gt;' + params.data_supplier + ' &lt;img alt=&quot;external link&quot; src=&quot;/images/external_link.png&quot;&gt;&lt;/a&gt; ' + params.data_supplier_icon  + '&lt;br /&gt;';
       } else { 
         field_notes_area += 'SUPPLIER: ' + params.data_supplier + '&lt;br /&gt;';
       }
@@ -116,7 +117,7 @@ function eol_update_credit(params){
         field_notes_area += 'AUTHOR: ' + params.authors_linked + '&lt;br /&gt;';
     }
     if (params.sources != '' &amp;&amp; params.info_url != '' &amp;&amp; params.info_url != null) {
- 				field_notes_area += 'SOURCE: &lt;a href=&quot;'+params.info_url+'&quot; class=&quot;external_link&quot;&gt;' +  params.sources + ' &lt;img alt=&quot;external link&quot; src=&quot;/images/external_link.png&quot;&gt;&lt;/a&gt;&lt;br /&gt;';
+ 				field_notes_area += 'SOURCE: &lt;a onclick=&quot;JavaScript:external_link(\'' + escape(params.info_url) + '\',true,false);return false;&quot; href=&quot;#&quot;&gt;' +  params.sources + ' &lt;img alt=&quot;external link&quot; src=&quot;/images/external_link.png&quot;&gt;&lt;/a&gt;&lt;br /&gt;';
     }
     else if (params.sources_linked != '') {
         field_notes_area += 'SOURCE:' + params.sources_linked + '&lt;br /&gt;';
@@ -155,8 +156,6 @@ function eol_update_credit(params){
 			 }
     $('field-notes').innerHTML = field_notes_area; // this is the 'gray box'
     // ! FIELD NOTES ! &lt;/end&gt;
-
-    EOL.reload_behaviors();
 }
 
 // Updates the main image and calls eol_update_credit()
@@ -311,6 +310,24 @@ function hideAjaxIndicator(on_content_area) {
     Element.hide('ajax-indicator');        
 }
 
+function external_link(link,new_window,show_popup) {
+  if (show_popup) {
+    var agree = confirm(&quot;The link you have clicked will take you to an external website.  Are you sure you wish to proceed?&quot;);
+  } else {
+    var agree = true;
+  }
+
+  if (agree) {
+    if (new_window) {
+      window.open('/external_link?url=' + link);
+    } else {
+      document.location.href='/external_link?url=' + link;
+    }
+  } else {
+    return false ;
+  }
+}
+
 function eol_log_data_objects_for_taxon_concept( taxon_concept_id, data_object_ids ) {
   // make a logging call to let the server know we have seen an object
   new Ajax.Request('/taxa/view_object/', {</diff>
      <filename>public/javascripts/misc.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5459c359a62eb789e54c39aee41e73aa3ebbe377</id>
    </parent>
  </parents>
  <author>
    <name>dima</name>
    <email>dima@78829999-583a-0410-bd01-8a9b849fd409</email>
  </author>
  <url>http://github.com/eol/eol/commit/c09e70db74fa0471d0b16bc15e0291d3d5760081</url>
  <id>c09e70db74fa0471d0b16bc15e0291d3d5760081</id>
  <committed-date>2009-01-14T14:05:09-08:00</committed-date>
  <authored-date>2009-01-14T14:05:09-08:00</authored-date>
  <message>merging with 2.0

git-svn-id: file:///data/subversion/eol/trunk@8 78829999-583a-0410-bd01-8a9b849fd409</message>
  <tree>a8605f1e03ca9e82ff9813b7ddd0bc81359bea69</tree>
  <committer>
    <name>dima</name>
    <email>dima@78829999-583a-0410-bd01-8a9b849fd409</email>
  </committer>
</commit>
