• Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /home/opgnylyd/public_html/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /home/opgnylyd/public_html/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /home/opgnylyd/public_html/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /home/opgnylyd/public_html/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /home/opgnylyd/public_html/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /home/opgnylyd/public_html/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6595 of /home/opgnylyd/public_html/includes/common.inc).
  • Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in _menu_load_objects() (line 579 of /home/opgnylyd/public_html/includes/menu.inc).
  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home/opgnylyd/public_html/includes/common.inc).

Replacing icons for attachments

31 Oct 2016
Section: 

Description

Replace standard icons of attached files (for the field type - file) on the another icons, for the Drupal themes. And the way to disable them altogether.

Solution

Override function theme_file_icon ($ variables) in the template.php file. YOUR_THEME - the name of your theme, file-icons - folder of icons in the theme folder, and the names of icons of files in that folder must have the original title:

  • application-octet-stream.png
  • application-pdf.png
  • application-x-executable.png
  • audio-x-generic.png
  • image-x-generic.png
  • package-x-generic.png
  • text-html.png
  • text-plain.png
  • text-x-generic.png
  • text-x-script.png
  • video-x-generic.png
  • x-office-document.png
  • x-office-presentation.png
  • x-office-spreadsheet.png

  1. function YOUR_THEME_file_icon($variables) {
  2.   $file = $variables['file'];
  3.   $icon_directory = drupal_get_path('theme', 'ТЕМА') . '/file-icons';
  4.  
  5.   $mime = check_plain($file->filemime);
  6.   $icon_url = file_icon_url($file, $icon_directory);
  7.   return '<img class="file-icon" alt="" title="' . $mime . '" src="' . $icon_url . '" />';
  8. }

And the way to turn off:

  1. function YOUR_THEME_file_icon($variables) {
  2.   return;
  3. }

Comments

cialis generic best price 22 Aug 2020
Trazodone Canada assuhotherse https://cialisse.com/ - cialis online purchase slalmstirl free cialis coupons SimeStuplilt <a href=https://cialisse.com/#>Cialis</a> TakBladial Side Effects Of Cephalexin For Dogs
cialis 5 mg best price usa 17 Sep 2020
Lasix Water Pill Over The Counter assuhotherse https://asocialiser.com/ - Cialis slalmstirl Stendra Cost SimeStuplilt <a href=https://asocialiser.com/#>generic cialis vs cialis</a> TakBladial Free Shipping Stendra
Impains 9 Dec 2020
Zyvox Non Prescription assuhotherse <a href=https://xbuycheapcialiss.com/>buy cialis online reviews</a> slalmstirl Interigo Keflex
exernemes 18 Dec 2020
Generic Levitra Legal assuhotherse <a href=https://bansocialism.com/>buy cialis online with prescription</a> slalmstirl Effetto Viagra Donne
exernemes 21 Dec 2020
Discount Brand Name Viagra assuhotherse <a href=https://bansocialism.com/>cheap generic cialis</a> slalmstirl Convencionales A Propecia
jaighek 12 Apr 2021
http://vslevitrav.com/ - levitra coupon free trial
lycleri 19 Apr 2021
https://vslevitrav.com/ - levitra for sale
Impains 30 Apr 2021
<a href=http://vsdoxycyclinev.com/>doxycyline no rx
exernemes 7 May 2021
<a href=https://vskamagrav.com/>kamagra 100 mg on line
fralleste 13 Jun 2021
<a href=https://vslasixv.com>lasix shop
fralleste 13 Jun 2021
<a href=https://vscialisv.com>cialis online prescription
fralleste 25 Jun 2021
<a href=http://vslevitrav.com>order levitra
fralleste 26 Jun 2021
<a href=https://clomidset.com>clomid oral tablet 50 mg order online
fralleste 7 Jul 2021
<a href=https://priligyset.com/>levitra with dapoxetine reviews</a>
fralleste 7 Jul 2021
<a href=http://fcialisj.com/>cialis</a>
fralleste 20 Jul 2021
<a href=http://fcialisj.com/>canadian pharmacy cialis</a>
fralleste 21 Jul 2021
<a href=https://propeciaset.com/>buy proscar brand</a>
fralleste 6 Aug 2021
<a href=http://cialiswwshop.com/>can you buy cialis online</a>
fralleste 7 Aug 2021
<a href=https://cialiswwshop.com/>can i buy cialis online</a>