claroline/claroline/inc/lib/image.lib.php File Reference

Go to the source code of this file.

Namespaces

namespace  KERNEL

Functions

 cutstring ($str, $length, $allow_cut_word=true, $extra_length=0, $ending="")
 is_image ($fileName)
 get_image_list ($fileList, $allowed=false)
 get_image_color_depth ($img)
 get_image_thumbnail_url ($file, $context=null)
 create_thumbnail ($file, $thumbWidth, $title= '')
 image_search ($file, $filePathList)
 get_current_index ($imageList, $fileIndex)
 has_next_image ($imageList, $index)
 has_previous_image ($imageList, $index)
 get_next_image_index ($imageList, $index)
 get_previous_image_index ($imageList, $index)
 display_link_to_previous_image ($imageList, $fileList, $current)
 display_link_to_next_image ($imageList, $fileList, $current)
 has_next_page ($imageList, $page)
 has_previous_page ($imageList, $page)
 get_offset ($page)
 get_page_number ($offset)
 display_thumbnails ($imageList, $fileList, $page, $thumbnailWidth, $colWidth, $numberOfCols, $numberOfRows)

Variables

 $allowedImageTypes = 'jpg|png|gif|jpeg|bmp'

Function Documentation

create_thumbnail ( file,
thumbWidth,
title = '' 
)

create thumbnails end return html code to display it

this function could be modified to use any other method to create thumbnails

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
file (string) image name
thumbWidth (int) width for thumbnails
title (string) long description of the image
Returns:
(string) html code to display thumbnail curDirPath coursesRepositoryWeb; coursesRepositorySys; _course;

Definition at line 171 of file image.lib.php.

cutstring ( str,
length,
allow_cut_word = true,
extra_length = 0,
ending = "" 
)

cut string allowing word integrity preservation

TODO : move to a more accurate library

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
string (string) string
length (int) length of the resulting string
allow_cut_word (boolean) allow word cutting default : true
extra_length (int) allow extra length to the string to preserve word integrity
ending (string) append the given string at the end of the cutted one
Returns:
(string) the cutted string

Definition at line 49 of file image.lib.php.

display_link_to_next_image ( imageList,
fileList,
current 
)

display link and thumbnail of next image TODO : see if this function can be merge with display_link_to_previous_image

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
imageList (array) list of image indices
fileList (array) list of files in the current directory
current (int) index of current image in imageList curDirPath thumbnailWidth

Definition at line 377 of file image.lib.php.

display_link_to_previous_image ( imageList,
fileList,
current 
)

display link and thumbnail of previous image TODO : see if this function can be merge with display_link_to_next_image

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
imageList (array) list of image indices
fileList (array) list of files in the current directory
current (int) index of current image in imageList curDirPath thumbnailWidth

Definition at line 315 of file image.lib.php.

display_thumbnails ( imageList,
fileList,
page,
thumbnailWidth,
colWidth,
numberOfCols,
numberOfRows 
)

display a page of thumbnails

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
imageList (array) list containing all image file names
fileList (array) file properties
page (int) current page number
thumbnailWidth (int) width of thumbnails
colWidth (int) width of columns
numberOfCols (int) number of columns
numberOfRows (int) number of rows curDirPath

Definition at line 523 of file image.lib.php.

get_current_index ( imageList,
fileIndex 
)

get the index of the current image in imageList from its index in fileList

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
imageList (array) list of index of image files in the current directory
fileIndex (array) index of image in fileList
Returns:
(int) index of current image in imageList
See also:
document.php::$fileList

Definition at line 230 of file image.lib.php.

get_image_color_depth ( img  ) 

get image color depth from image info

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
img (string) path to image file
Returns:
(int) image depth in bits
See also:
document.php::$fileList

Definition at line 141 of file image.lib.php.

get_image_list ( fileList,
allowed = false 
)

get image list from fileList

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
fileList (array) list of files in the current directory
allowed (bool) true if current user is allowed to view invisible images
Returns:
(array) array containing the index of image files in fileList
See also:
document.php::$fileList

Definition at line 114 of file image.lib.php.

get_image_thumbnail_url ( file,
context = null 
)

Definition at line 147 of file image.lib.php.

get_next_image_index ( imageList,
index 
)

return the index of the next image in imageList

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
imageList (array) list of image indices
index (int) index of current image in imageList
Returns:
(int) index of the next image in imageList

Definition at line 279 of file image.lib.php.

get_offset ( page  ) 

return the index of the first image of the given page in imageList

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
page (int) number of the page
Returns:
(int) index of the first image of the given page in imageList

Definition at line 476 of file image.lib.php.

get_page_number ( offset  ) 

return the number of the page on which the image is located

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
offset (int) index of the image in imageList
Returns:
(int) number of the page on which the image is located

Definition at line 500 of file image.lib.php.

get_previous_image_index ( imageList,
index 
)

return the index of the previous image in imageList

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
imageList (array) list of image indices
index (int) index of current image in imageList
Returns:
(int) index of the previous image in imageList

Definition at line 295 of file image.lib.php.

has_next_image ( imageList,
index 
)

return true if there one or more image after the current image in imageList

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
imageList (array) list of image indices
index (int) index of current image in imageList
Returns:
(bool) true if there is one or more images after the current image in imageList, else return false

Definition at line 252 of file image.lib.php.

has_next_page ( imageList,
page 
)

return true if there are one or more pages left to display after the current one

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
imageList (array) list of image indices
page (int) number of current page
Returns:
(bool) true if there are one or more pages left to display after the current one

Definition at line 441 of file image.lib.php.

has_previous_image ( imageList,
index 
)

return true if there one or more image before the current image in imageList

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
imageList (array) list of image indices
index (int) index of current image in imageList
Returns:
(bool) true if there is one or more images before the current image in imageList, else return false

Definition at line 266 of file image.lib.php.

has_previous_page ( imageList,
page 
)

return true if there one or more pages left to display before the current one

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
imageList (array) list of image indices
index (int) index of current image in imageList
Returns:
(bool) true if there are one or more pages left to display before the current one

Definition at line 464 of file image.lib.php.

image_search ( file,
filePathList 
)

Definition at line 203 of file image.lib.php.

is_image ( fileName  ) 

identifies images (i.e. if file extension is an allowed image extension)

Author:
Frederic Minne <minne@ipm.ucl.ac.be>
Parameters:
string (string) file name
Returns:
(bool) true if the given file is an image file else return false allowedImageTypes
See also:
images.lib.php::$allowedImagesType

Definition at line 90 of file image.lib.php.


Variable Documentation

$allowedImageTypes = 'jpg|png|gif|jpeg|bmp'

allowedImageTypes

Definition at line 32 of file image.lib.php.

Generated on Tue Jun 8 12:28:37 2010 for Claroline API by  doxygen 1.6.3