Diff
checker
Text
Text
Bilder
Dokumente
Excel
Ordner
Legal
Enterprise
Desktop-App
Preise
Einloggen
Diffchecker Desktop herunterladen
Texte vergleichen
Finde den Unterschied zwischen zwei Textdateien
Werkzeuge
Verlauf
Live-Editor
Leerzeichen ausblenden
Gleiches ausblenden
Zeilenumbruch aus
Ansicht
Zweispaltig
Einspaltig
Vergleichsgenauigkeit
Intelligent
Wort
Zeichen
Textstile
Darstellung ändern
Syntaxhervorhebung
Syntax auswählen
Ignorieren
Text umwandeln
Zur ersten Änderung
Eingabe bearbeiten
Diffchecker Desktop
Der sicherste Weg, Diffchecker zu nutzen. Hol dir die Desktop-App: Deine Diffs verlassen nie deinen Computer!
Desktop holen
Untitled diff
Erstellt
vor 11 Jahren
Diff läuft nie ab
Löschen
Exportieren
Teilen
Erklären
10 Entfernungen
Zeilen
Gesamt
Entfernt
Zeichen
Gesamt
Entfernt
Um diese Funktion weiterhin zu nutzen, aktualisiere auf
Diff
checker
Pro
Preise anzeigen
154 Zeilen
Kopieren
26 Hinzufügungen
Zeilen
Gesamt
Hinzugefügt
Zeichen
Gesamt
Hinzugefügt
Um diese Funktion weiterhin zu nutzen, aktualisiere auf
Diff
checker
Pro
Preise anzeigen
156 Zeilen
Kopieren
<?php
<?php
/**
/**
* @file
* @file
* Tha main file of the module.
* Tha main file of the module.
*/
*/
/**
/**
* Implements hook_menu().
* Implements hook_menu().
*/
*/
function taxonomy_tooltip_menu() {
function taxonomy_tooltip_menu() {
$items['admin/config/content/taxonomy-tooltip'] = array(
$items['admin/config/content/taxonomy-tooltip'] = array(
'title' => 'Taxonomy tooltip',
'title' => 'Taxonomy tooltip',
'page callback' => 'drupal_get_form',
'page callback' => 'drupal_get_form',
'page arguments' => array('taxonomy_tooltip_settings_form'),
'page arguments' => array('taxonomy_tooltip_settings_form'),
'access arguments' => array('administer taxonomy tooltip'),
'access arguments' => array('administer taxonomy tooltip'),
'file' => 'taxonomy_tooltip.admin.inc',
'file' => 'taxonomy_tooltip.admin.inc',
);
);
return $items;
return $items;
}
}
/**
/**
* Implements hook_permission().
* Implements hook_permission().
*/
*/
function taxonomy_tooltip_permission() {
function taxonomy_tooltip_permission() {
return array(
return array(
'administer taxonomy tooltip' => array(
'administer taxonomy tooltip' => array(
'title' => t('Administer taxonomy tooltip'),
'title' => t('Administer taxonomy tooltip'),
),
),
);
);
}
}
/**
/**
* Implements hook_init().
* Implements hook_init().
*/
*/
function taxonomy_tooltip_init() {
function taxonomy_tooltip_init() {
libraries_load('jquery-tooltip');
libraries_load('jquery-tooltip');
drupal_add_js(drupal_get_path('module', 'taxonomy_tooltip') . '/taxonomy_tooltip.js');
drupal_add_js(drupal_get_path('module', 'taxonomy_tooltip') . '/taxonomy_tooltip.js');
drupal_add_css(drupal_get_path('module', 'taxonomy_tooltip') . '/taxonomy_tooltip.css');
drupal_add_css(drupal_get_path('module', 'taxonomy_tooltip') . '/taxonomy_tooltip.css');
}
}
/**
/**
* Implements hook_libraries_info().
* Implements hook_libraries_info().
*/
*/
function taxonomy_tooltip_libraries_info() {
function taxonomy_tooltip_libraries_info() {
$libraries['jquery-tooltip'] = array(
$libraries['jquery-tooltip'] = array(
'name' => 'jQuery Tooltip',
'name' => 'jQuery Tooltip',
'vendor url' => 'http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/',
'vendor url' => 'http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/',
'download url' => 'http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/',
'download url' => 'http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/',
'version arguments' => array(
'version arguments' => array(
'file' => 'jquery.tooltip.min.js',
'file' => 'jquery.tooltip.min.js',
'pattern' => '/jQuery Tooltip plugin ([0-9\.]+)/',
'pattern' => '/jQuery Tooltip plugin ([0-9\.]+)/',
'lines' => 2,
'lines' => 2,
),
),
'files' => array(
'files' => array(
'js' => array(
'js' => array(
'jquery.tooltip.min.js',
'jquery.tooltip.min.js',
),
),
'css' => array(
'css' => array(
'jquery.tooltip.css',
'jquery.tooltip.css',
),
),
),
),
'variants' => array(
'variants' => array(
'minified' => array(
'minified' => array(
'files' => array(
'files' => array(
'js' => array(
'js' => array(
'jquery.tooltip.min.js',
'jquery.tooltip.min.js',
),
),
'css' => array(
'css' => array(
'jquery.tooltip.css',
'jquery.tooltip.css',
),
),
),
),
),
),
'source' => array(
'source' => array(
'files' => array(
'files' => array(
'js' => array(
'js' => array(
'jquery.tooltip.js',
'jquery.tooltip.js',
),
),
'css' => array(
'css' => array(
'jquery.tooltip.css',
'jquery.tooltip.css',
),
),
),
),
),
),
),
),
);
);
return $libraries;
return $libraries;
}
}
/**
/**
* Implements hook_filter_info().
* Implements hook_filter_info().
*/
*/
function taxonomy_tooltip_filter_info() {
function taxonomy_tooltip_filter_info() {
$filters['taxonomy_tooltip'] = array(
$filters['taxonomy_tooltip'] = array(
'title' => t('Taxonomy tooltip'),
'title' => t('Taxonomy tooltip'),
'process callback' => 'taxonomy_tooltip_filter_process',
'process callback' => 'taxonomy_tooltip_filter_process',
);
);
return $filters;
return $filters;
}
}
/**
/**
* Returns with the replaced content.
* Returns with the replaced content.
*
*
* Finds for the term names and changes with the description tooltip.
* Finds for the term names and changes with the description tooltip.
*/
*/
function taxonomy_tooltip_filter_process($text, $filter, $format, $langcode, $cache, $cache_id) {
function taxonomy_tooltip_filter_process($text, $filter, $format, $langcode, $cache, $cache_id) {
// Check that the variable is set.
// Check that the variable is set.
if ($vocabs = variable_get('taxonomy_tooltip_vocabs', array())) {
if ($vocabs = variable_get('taxonomy_tooltip_vocabs', array())) {
// Performance tuning.
// Performance tuning.
$pattern_map = &drupal_static(__FUNCTION__);
$pattern_map = &drupal_static(__FUNCTION__);
if (!$pattern_map) {
if (!$pattern_map) {
// Initialize the array.
// Initialize the array.
$pattern_map['map'] = array();
$pattern_map['map'] = array();
$pattern_map['tooltips'] = '';
$pattern_map['tooltips'] = '';
foreach ($vocabs as $vid => $enabled) {
foreach ($vocabs as $vid => $enabled) {
if ($enabled) {
if ($enabled) {
$vids[] = $vid;
$vids[] = $vid;
}
}
}
}
// Get the terms.
// Get the terms.
$query = db_select('taxonomy_term_data', 't');
$query = db_select('taxonomy_term_data', 't');
$result = $query
$result = $query
Kopieren
Kopiert
Kopieren
Kopiert
->addTag('translatable')
->addTag('translatable')
->addTag('term_access')
->addTag('term_access')
->fields('t')
->fields('t')
->condition('t.vid', $vids, 'IN')
->condition('t.vid', $vids, 'IN')
->execute();
->execute();
// Create map array. The first character must be a space and after the
// Create map array. The first character must be a space and after the
// word must be space, ".", ",", "?" or "!" character.
// word must be space, ".", ",", "?" or "!" character.
Kopieren
Kopiert
Kopieren
Kopiert
foreach ($result as $id => $term) {
foreach ($result as $id => $term) {
Kopieren
Kopiert
Kopieren
Kopiert
if (trim($term->description)
) {
if (trim($term->description)
!== ''
) {
$pattern_map['
map
'][
'/( ' . drupal_strtolower($term->name) . '[ .,?!])/i'
] = '<span class="taxonomy-tooltip-element" rel="taxonomy-tooltip-' . $id .
'">$1</span>';
$pattern_map['
pattern
'][
] =
'/( ' . drupal_strtolower($term->name) . '[ .,?!])/i'
;
// Move the tooltips to a separate to keep valid HTML.
$pattern_map['replace'][
] = '<span class="taxonomy-tooltip-element" rel="taxonomy-tooltip-' . $id .
'">$1</span>';
$
pattern_map['
tooltips
']
.=
'<div class="taxonomy-tooltip-' . $id .
' taxonomy-tooltip">' . check_markup($term->description, $term->format) . '</div>';
$
tooltips
.=
'<div class="taxonomy-tooltip-' . $id .
' taxonomy-tooltip">' . check_markup($term->description, $term->format) . '</div>';
}
}
}
}
Kopieren
Kopiert
Kopieren
Kopiert
}
Kopieren
Kopiert
Kopieren
Kopiert
// Replace the text with the modified "tooltipped" one.
// Replace the text with the modified "tooltipped" one.
foreach ($pattern_map['map'] as $pattern => $replace) {
$text = preg_replace($pattern
_map['pattern']
, $
pattern_map['
replace
']
, $text);
$text = preg_replace($pattern
, $
replace
, $text);
// Append tooltips to the end of the content.
$text .= $tooltips;
}
}
Kopieren
Kopiert
Kopieren
Kopiert
// Append tooltips to the end of the content.
$text .= $pattern_map['tooltips'];
}
}
Kopieren
Kopiert
Kopieren
Kopiert
return $text;
return $text;
}
}
Kopieren
Kopiert
Kopieren
Kopiert
?>
Gespeicherte Diffs
Originaltext
Datei öffnen
<?php /** * @file * Tha main file of the module. */ /** * Implements hook_menu(). */ function taxonomy_tooltip_menu() { $items['admin/config/content/taxonomy-tooltip'] = array( 'title' => 'Taxonomy tooltip', 'page callback' => 'drupal_get_form', 'page arguments' => array('taxonomy_tooltip_settings_form'), 'access arguments' => array('administer taxonomy tooltip'), 'file' => 'taxonomy_tooltip.admin.inc', ); return $items; } /** * Implements hook_permission(). */ function taxonomy_tooltip_permission() { return array( 'administer taxonomy tooltip' => array( 'title' => t('Administer taxonomy tooltip'), ), ); } /** * Implements hook_init(). */ function taxonomy_tooltip_init() { libraries_load('jquery-tooltip'); drupal_add_js(drupal_get_path('module', 'taxonomy_tooltip') . '/taxonomy_tooltip.js'); drupal_add_css(drupal_get_path('module', 'taxonomy_tooltip') . '/taxonomy_tooltip.css'); } /** * Implements hook_libraries_info(). */ function taxonomy_tooltip_libraries_info() { $libraries['jquery-tooltip'] = array( 'name' => 'jQuery Tooltip', 'vendor url' => 'http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/', 'download url' => 'http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/', 'version arguments' => array( 'file' => 'jquery.tooltip.min.js', 'pattern' => '/jQuery Tooltip plugin ([0-9\.]+)/', 'lines' => 2, ), 'files' => array( 'js' => array( 'jquery.tooltip.min.js', ), 'css' => array( 'jquery.tooltip.css', ), ), 'variants' => array( 'minified' => array( 'files' => array( 'js' => array( 'jquery.tooltip.min.js', ), 'css' => array( 'jquery.tooltip.css', ), ), ), 'source' => array( 'files' => array( 'js' => array( 'jquery.tooltip.js', ), 'css' => array( 'jquery.tooltip.css', ), ), ), ), ); return $libraries; } /** * Implements hook_filter_info(). */ function taxonomy_tooltip_filter_info() { $filters['taxonomy_tooltip'] = array( 'title' => t('Taxonomy tooltip'), 'process callback' => 'taxonomy_tooltip_filter_process', ); return $filters; } /** * Returns with the replaced content. * * Finds for the term names and changes with the description tooltip. */ function taxonomy_tooltip_filter_process($text, $filter, $format, $langcode, $cache, $cache_id) { // Check that the variable is set. if ($vocabs = variable_get('taxonomy_tooltip_vocabs', array())) { // Performance tuning. $pattern_map = &drupal_static(__FUNCTION__); if (!$pattern_map) { // Initialize the array. $pattern_map['map'] = array(); $pattern_map['tooltips'] = ''; foreach ($vocabs as $vid => $enabled) { if ($enabled) { $vids[] = $vid; } } // Get the terms. $query = db_select('taxonomy_term_data', 't'); $result = $query ->addTag('translatable') ->addTag('term_access') ->fields('t') ->condition('t.vid', $vids, 'IN') ->execute(); // Create map array. The first character must be a space and after the // word must be space, ".", ",", "?" or "!" character. foreach ($result as $id => $term) { if (trim($term->description)) { $pattern_map['map']['/( ' . drupal_strtolower($term->name) . '[ .,?!])/i'] = '<span class="taxonomy-tooltip-element" rel="taxonomy-tooltip-' . $id .'">$1</span>'; // Move the tooltips to a separate to keep valid HTML. $pattern_map['tooltips'] .= '<div class="taxonomy-tooltip-' . $id .' taxonomy-tooltip">' . check_markup($term->description, $term->format) . '</div>'; } } } // Replace the text with the modified "tooltipped" one. foreach ($pattern_map['map'] as $pattern => $replace) { $text = preg_replace($pattern, $replace, $text); } // Append tooltips to the end of the content. $text .= $pattern_map['tooltips']; } return $text; }
Bearbeitung
Datei öffnen
<?php /** * @file * Tha main file of the module. */ /** * Implements hook_menu(). */ function taxonomy_tooltip_menu() { $items['admin/config/content/taxonomy-tooltip'] = array( 'title' => 'Taxonomy tooltip', 'page callback' => 'drupal_get_form', 'page arguments' => array('taxonomy_tooltip_settings_form'), 'access arguments' => array('administer taxonomy tooltip'), 'file' => 'taxonomy_tooltip.admin.inc', ); return $items; } /** * Implements hook_permission(). */ function taxonomy_tooltip_permission() { return array( 'administer taxonomy tooltip' => array( 'title' => t('Administer taxonomy tooltip'), ), ); } /** * Implements hook_init(). */ function taxonomy_tooltip_init() { libraries_load('jquery-tooltip'); drupal_add_js(drupal_get_path('module', 'taxonomy_tooltip') . '/taxonomy_tooltip.js'); drupal_add_css(drupal_get_path('module', 'taxonomy_tooltip') . '/taxonomy_tooltip.css'); } /** * Implements hook_libraries_info(). */ function taxonomy_tooltip_libraries_info() { $libraries['jquery-tooltip'] = array( 'name' => 'jQuery Tooltip', 'vendor url' => 'http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/', 'download url' => 'http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/', 'version arguments' => array( 'file' => 'jquery.tooltip.min.js', 'pattern' => '/jQuery Tooltip plugin ([0-9\.]+)/', 'lines' => 2, ), 'files' => array( 'js' => array( 'jquery.tooltip.min.js', ), 'css' => array( 'jquery.tooltip.css', ), ), 'variants' => array( 'minified' => array( 'files' => array( 'js' => array( 'jquery.tooltip.min.js', ), 'css' => array( 'jquery.tooltip.css', ), ), ), 'source' => array( 'files' => array( 'js' => array( 'jquery.tooltip.js', ), 'css' => array( 'jquery.tooltip.css', ), ), ), ), ); return $libraries; } /** * Implements hook_filter_info(). */ function taxonomy_tooltip_filter_info() { $filters['taxonomy_tooltip'] = array( 'title' => t('Taxonomy tooltip'), 'process callback' => 'taxonomy_tooltip_filter_process', ); return $filters; } /** * Returns with the replaced content. * * Finds for the term names and changes with the description tooltip. */ function taxonomy_tooltip_filter_process($text, $filter, $format, $langcode, $cache, $cache_id) { // Check that the variable is set. if ($vocabs = variable_get('taxonomy_tooltip_vocabs', array())) { // Performance tuning. $pattern_map = &drupal_static(__FUNCTION__); if (!$pattern_map) { // Initialize the array. $pattern_map['map'] = array(); $pattern_map['tooltips'] = ''; foreach ($vocabs as $vid => $enabled) { if ($enabled) { $vids[] = $vid; } } // Get the terms. $query = db_select('taxonomy_term_data', 't'); $result = $query ->addTag('translatable') ->addTag('term_access') ->fields('t') ->condition('t.vid', $vids, 'IN') ->execute(); // Create map array. The first character must be a space and after the // word must be space, ".", ",", "?" or "!" character. foreach ($result as $id => $term) { if (trim($term->description) !== '') { $pattern_map['pattern'][] = '/( ' . drupal_strtolower($term->name) . '[ .,?!])/i'; $pattern_map['replace'][] = '<span class="taxonomy-tooltip-element" rel="taxonomy-tooltip-' . $id . '">$1</span>'; $tooltips .= '<div class="taxonomy-tooltip-' . $id . ' taxonomy-tooltip">' . check_markup($term->description, $term->format) . '</div>'; } } // Replace the text with the modified "tooltipped" one. $text = preg_replace($pattern_map['pattern'], $pattern_map['replace'], $text); // Append tooltips to the end of the content. $text .= $tooltips; } } return $text; } ?>
Unterschied finden