<commit_before><?php
/**
 * sharethis_LinkService
 * @package sharethis
 */
class sharethis_LinkService extends f_persistentdocument_DocumentService
{
	/**
	 * @var sharethis_LinkService
	 */
	private static $instance;

	/**
	 * @return sharethis_LinkService
	 */
	public static function getInstance()
	{
		if (self::$instance === null)
		{
			self::$instance = self::getServiceClassInstance(get_class());
		}
		return self::$instance;
	}

	/**
	 * @return sharethis_persistentdocument_link
	 */
	public function getNewDocumentInstance()
	{
		return $this->getNewDocumentInstanceByModelName('modules_sharethis/link');
	}

	/**
	 * Create a query based on 'modules_sharethis/link' model.
	 * Return document that are instance of modules_sharethis/link,
	 * including potential children.
	 * @return f_persistentdocument_criteria_Query
	 */
	public function createQuery()
	{
		return $this->pp->createQuery('modules_sharethis/link');
	}
	
	/**
	 * Create a query based on 'modules_sharethis/link' model.
	 * Only documents that are strictly instance of modules_sharethis/link
	 * (not children) will be retrieved
	 * @return f_persistentdocument_criteria_Query
	 */
	public function createStrictQuery()
	{
		return $this->pp->createQuery('modules_sharethis/link', false);
	}

	/**
	 * @param sharethis_persistentdocument_link $document
	 * @param String $url
	 * @param String $title
	 * @return String
	 */
	public function getShareUrlIndirection($document, $url, $title)
	{
		return LinkHelper::getActionUrl('sharethis', 'ShareUrl', array('cmpref' => $document->getId(), 'url' => $url, 'title' => $title));
	}

	/**
	 * @param sharethis_persistentdocument_link $document
	 * @param String $url
	 * @param String $title
	 * @param String $varSeparator
	 * @return String
	 */
	public function getShareUrl($document, $url, $title, $varSeparator = '&amp;')
	{
		return null;
	}

	/**
	 * @param sharethis_persistentdocument_link $document
	 * @param String $url
	 * @param String $title
	 * @return String
	 */
	public function getShareOnclick($document, $url, $title)
	{
		if ($document->getPopup())
		{
			return 'accessiblePopup(this); return false;';
		}		
		return null;
	}
	
	/**
	 * @return sharethis_persistentdocument_site[]
	 */
	public function getAllPublishedBoSorted()
	{
		$query = $this->createQuery()->add(Restrictions::published());
		$query->add(Restrictions::descendentOf(ModuleService::getInstance()->getRootFolderId('sharethis')));
		return $query->find();
	}
	
	/**
	 * @param sharethis_persistentdocument_group $group
	 * @return sharethis_persistentdocument_site[]
	 */
	public function getPublishedBoSortedByGroup($group)
	{		
		$query = $this->createQuery()->add(Restrictions::published());
		$query->add(Restrictions::descendentOf(ModuleService::getInstance()->getRootFolderId('sharethis')));
		$query->add(Restrictions::eq('group', $group));
		return $query->find();
	}
	
	/**
	 * @param String $string
	 * @param Array $replacements
	 */
	protected function applyReplacements($string, $replacements)
	{
		if (!$string)
		{<commit_msg>[FIX #56396] Ordre des icônes de partage<commit_after><?php
/**
 * sharethis_LinkService
 * @package sharethis
 */
class sharethis_LinkService extends f_persistentdocument_DocumentService
{
	/**
	 * @var sharethis_LinkService
	 */
	private static $instance;

	/**
	 * @return sharethis_LinkService
	 */
	public static function getInstance()
	{
		if (self::$instance === null)
		{
			self::$instance = self::getServiceClassInstance(get_class());
		}
		return self::$instance;
	}

	/**
	 * @return sharethis_persistentdocument_link
	 */
	public function getNewDocumentInstance()
	{
		return $this->getNewDocumentInstanceByModelName('modules_sharethis/link');
	}

	/**
	 * Create a query based on 'modules_sharethis/link' model.
	 * Return document that are instance of modules_sharethis/link,
	 * including potential children.
	 * @return f_persistentdocument_criteria_Query
	 */
	public function createQuery()
	{
		return $this->pp->createQuery('modules_sharethis/link');
	}
	
	/**
	 * Create a query based on 'modules_sharethis/link' model.
	 * Only documents that are strictly instance of modules_sharethis/link
	 * (not children) will be retrieved
	 * @return f_persistentdocument_criteria_Query
	 */
	public function createStrictQuery()
	{
		return $this->pp->createQuery('modules_sharethis/link', false);
	}

	/**
	 * @param sharethis_persistentdocument_link $document
	 * @param String $url
	 * @param String $title
	 * @return String
	 */
	public function getShareUrlIndirection($document, $url, $title)
	{
		return LinkHelper::getActionUrl('sharethis', 'ShareUrl', array('cmpref' => $document->getId(), 'url' => $url, 'title' => $title));
	}

	/**
	 * @param sharethis_persistentdocument_link $document
	 * @param String $url
	 * @param String $title
	 * @param String $varSeparator
	 * @return String
	 */
	public function getShareUrl($document, $url, $title, $varSeparator = '&amp;')
	{
		return null;
	}

	/**
	 * @param sharethis_persistentdocument_link $document
	 * @param String $url
	 * @param String $title
	 * @return String
	 */
	public function getShareOnclick($document, $url, $title)
	{
		if ($document->getPopup())
		{
			return 'accessiblePopup(this); return false;';
		}		
		return null;
	}
	
	/**
	 * @return sharethis_persistentdocument_site[]
	 */
	public function getAllPublishedBoSorted()
	{
		$query = $this->createQuery()->add(Restrictions::published());
		$query->add(Restrictions::descendentOf(ModuleService::getInstance()->getRootFolderId('sharethis')));
		return $query->find();
	}
	
	/**
	 * @param sharethis_persistentdocument_group $group
	 * @return sharethis_persistentdocument_site[]
	 */
	public function getPublishedBoSortedByGroup($group)
	{		
		return $group->getPublishedLinksArray();
	}
	
	/**
	 * @param String $string
	 * @param Array $replacements
	 */
	protected function applyReplacements($string, $replacements)
	{
		if (!$string)
		{
{'fraction_non_alphanumeric': 0.13704388767445772, 'fraction_numerical': 0.0008407600470825626, 'mean_word_length': 4.719230769230769, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2628562', 'n_tokens_mistral': 1959, 'n_tokens_neox': 1804, 'n_words': 389}