[ Index ]
 

Code source de Typo3 4.1.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/t3lib/ -> class.t3lib_iconworks.php (sommaire)

Contains class for icon generation in the backend $Id: class.t3lib_iconworks.php 1421 2006-04-10 09:27:15Z mundaun $ Revised for TYPO3 3.6 July/2003 by Kasper Skaarhoj XHTML compliant

Author: Kasper Skaarhoj <kasperYYYY@typo3.com>
Poids: 530 lignes (21 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

t3lib_iconWorks:: (7 méthodes):
  getIconImage()
  getIcon()
  skinImg()
  makeIcon()
  imagecopyresized()
  imagecreatefrom()
  imagemake()


Classe: t3lib_iconWorks  - X-Ref

Icon generation, backend
This library has functions that returns - and if necessary creates - the icon for an element in TYPO3

Expects global vars:
- $BACK_PATH
- PATH_typo3
- $TCA, $PAGES_TYPES


Notes:
These functions are strongly related to the interface of TYPO3.
The class is included in eg. init.php
ALL functions called without making a class instance, eg. "t3lib_iconWorks::getIconImage()"

getIconImage($table,$row=array()   X-Ref
Returns an icon image tag, 18x16 pixels, based on input information.
This function is recommended to use in your backend modules.
Usage: 60

param: string        The table name
param: array        The table row ("enablefields" are at least needed for correct icon display and for pages records some more fields in addition!)
param: string        The backpath to the main TYPO3 directory (relative path back to PATH_typo3)
param: string        Additional attributes for the image tag
param: boolean        If set, the icon will be grayed/shaded
return: string        <img>-tag

getIcon($table,$row=array()   X-Ref
Creates the icon for input table/row
Returns filename for the image icon, relative to PATH_typo3
Usage: 24

param: string        The table name
param: array        The table row ("enablefields" are at least needed for correct icon display and for pages records some more fields in addition!)
param: boolean        If set, the icon will be grayed/shaded
return: string        Icon filename

skinImg($backPath,$src,$wHattribs='',$outputMode=0)   X-Ref
Returns the src=... for the input $src value OR any alternative found in $TBE_STYLES['skinImg']
Used for skinning the TYPO3 backend with an alternative set of icons
Usage: 336

param: string        Current backpath to PATH_typo3 folder
param: string        Icon file name relative to PATH_typo3 folder
param: string        Default width/height, defined like 'width="12" height="14"'
param: integer        Mode: 0 (zero) is default and returns src/width/height. 1 returns value of src+backpath, 2 returns value of w/h.
return: string        Returns ' src="[backPath][src]" [wHattribs]'

makeIcon($iconfile,$mode, $user, $protectSection,$absFile,$iconFileName_stateTagged)   X-Ref
Creates the icon file for the function getIcon()

param: string        Original unprocessed Icon file, relative path to PATH_typo3
param: string        Mode string, eg. "deleted" or "futuretiming" determining how the icon will look
param: integer        The number of the fe_group record uid if applicable
param: boolean        Flag determines if the protected-section icon should be applied.
param: string        Absolute path to file from which to create the icon.
param: string        The filename that this icon should have had, basically [icon base name]_[flags].[extension] - used for part of temporary filename
return: string        Filename relative to PATH_typo3

imagecopyresized(&$im, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $w, $h, $w, $h)   X-Ref
The necessity of using this function for combining two images if GD is version 2 is that
GD2 cannot manage to combine two indexed-color images without totally spoiling everything.
In class.t3lib_stdgraphic this was solved by combining the images onto a first created true color image
However it has turned out that this method will not work if the indexed png-files contains transparency.
So I had to turn my attention to ImageMagick - my 'enemy of death'.
And so it happend - ImageMagick is now used to combine my two indexed-color images with transparency. And that works.
Of course it works only if ImageMagick is able to create valid png-images - which you cannot be sure of with older versions (still 5+)
The only drawback is (apparently) that IM creates true-color png's. The transparency of these will not be shown by MSIE on windows at this time (although it's straight 0%/100% transparency!) and the file size may be larger.

For parameters, see PHP function "imagecopyresized()"

param: pointer        see PHP function "imagecopyresized()"
param: pointer        see PHP function "imagecopyresized()"
param: integer        see PHP function "imagecopyresized()"
param: integer        see PHP function "imagecopyresized()"
param: integer        see PHP function "imagecopyresized()"
param: integer        see PHP function "imagecopyresized()"
param: integer        see PHP function "imagecopyresized()"
param: integer        see PHP function "imagecopyresized()"
param: integer        see PHP function "imagecopyresized()"
param: integer        see PHP function "imagecopyresized()"
return: void

imagecreatefrom($file)   X-Ref
Create new image pointer from input file (either gif/png, in case the wrong format it is converted by t3lib_div::read_png_gif())

param: string        Absolute filename of the image file from which to start the icon creation.
return: mixed        If success, image pointer, otherwise "-1"

imagemake($im, $path)   X-Ref
Write the icon in $im pointer to $path

param: pointer        Pointer to GDlib image resource
param: string        Absolute path to the filename in which to write the icon.
return: void



Généré le : Sun Nov 25 17:13:16 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics