<commit_before><?php
/**
 * A google file download tracker that add a onclick attribute for anchors generated by change:download.
 * In project.xml :
 * <modules>
 *   <media>
      <additionnalDownloadAttributesBuilders>
         <entry>markergas_DownloadTracker</entry>
      </additionnalDownloadAttributesBuilders>
     </media>
 * </modules>
 * @see PHPTAL_Php_Attribute_CHANGE_download 
 */
class markergas_DownloadTracker implements f_DownloadAttributeBuilder
{
	/**
	 * @param f_persistentdocument_PersistentDocument $media
	 * @param String $class
	 * @return array<String, String>
	 */
	function getAttributes($media, $class)
	{
		$path = f_Locale::translate('&modules.markergas.frontoffice.MediaDownloadPath;')."/".$media->getDocumentService()->getPathOf($media)."/".$media->getLabel();
		return array("onclick" => "javascript: pageTracker._trackPageview ('".str_replace("'", "\\'", $path)."');");
	}
}<commit_msg>[FIX] Ajout class download sur lien de telechargement<commit_after><?php
/**
 * A google file download tracker that add a onclick attribute for anchors generated by change:download.
 * In project.xml :
 * <modules>
 *   <media>
      <additionnalDownloadAttributesBuilders>
         <entry>markergas_DownloadTracker</entry>
      </additionnalDownloadAttributesBuilders>
     </media>
 * </modules>
 * @see PHPTAL_Php_Attribute_CHANGE_download 
 */
class markergas_DownloadTracker implements f_DownloadAttributeBuilder
{
	/**
	 * @param f_persistentdocument_PersistentDocument $media
	 * @param String $class
	 * @return array<String, String>
	 */
	function getAttributes($media, $class)
	{
		$path = f_Locale::translate('&modules.markergas.frontoffice.MediaDownloadPath;')."/".$media->getDocumentService()->getPathOf($media)."/".$media->getLabel();
		return array("class" => "link download", "onclick" => "javascript: pageTracker._trackPageview ('".str_replace("'", "\\'", $path)."');");
	}
}
{'fraction_non_alphanumeric': 0.14859228362878, 'fraction_numerical': 0.0, 'mean_word_length': 5.1506410256410255, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5359990', 'n_tokens_mistral': 585, 'n_tokens_neox': 556, 'n_words': 112}