gallery2.php File Reference

Go to the source code of this file.

Classes

class  gallery2_viewType_interface
 The interface definition of the gallery2_viewType. More...
class  gallery2_viewType_table
 The Table view-type class for the new gallery. More...
class  gallery2_viewType_oldstyle
 The interface definition of the gallery2_viewType. More...

Functions

 loadSubgalleries ()
 loadImages ()
 save ()
 getGlobalID ($editingFunction)
 getBreadcrumbs ()
 optionSubgalleries ($currentGallery="", $level)
 countSubImages ()
 userCanEdit ()
 userCanView ()
 renderEditor ()
 render ()
 parse_gallery2 ($page_data)
 profilemodule_gallery2 ()
 modulesetup_gallery2 ()
 globalID_gallery2 ($splitID)
 globalIDThumbnail_gallery2 ($splitID)

Variables

 $modules_names [] = "Gallery2"
 $modules_versions [] = "0.1"
 $modules_descriptions [] = "A simple but powerful gallery"
 $modules_setup [] = "modulesetup_gallery2"
 $profilemodules [] = "profilemodule_gallery2"
 $modules_globalID [] = "globalID_gallery2"
 $modules [] = "parse_gallery2"
 $page_help ["\gallery(txt1)"] = "This will show the gallery with the global ID txt1."
 $page_help ["\galleryimage(txt1,txt2,txt3)"] = "This will show the image thumbnail for the image with the global ID txt1. If txt2 is present the image will be floated to the alignment as described. Accepted values are left, center and right. If you write anything at all as txt3, the shown thumbnail will not be linked to the midsize view. If omitted, the image will be linked."
 $page_help ["\profilegallerylist(txt1)"] = "This will show a list of profiles where there is at least one image in the user's profile gallery. txt1 is optional, and is the style of listing. Defaults to three-up."
 $gallery_options
else $this baseurl = $module_folder . "/gallery/"
$this title = $gallery["title"]
$this description = $gallery["description"]
$this viewType = $gallery["viewType"]
$this viewLevel = $gallery["viewLevel"]
$this commentLevel = $gallery["commentLevel"]
$this editLevel = $gallery["editLevel"]
$this embedLevel = $gallery["embedLevel"]
$this imageOrder = $gallery["imageOrder"]
$this images = array()
else $filecontents = "No title\nNo description file found"
 $galleryinfobegpos = strpos( $filecontents, "\n" )
 $gallery2_viewTypes [] = "table"


Function Documentation

countSubImages (  ) 

Count the amount of images in this and subgalleries

Returns:
Integer containing the number of images in this and all subgalleries

Definition at line 790 of file gallery2.php.

References images, loadImages(), and loadSubgalleries().

Here is the call graph for this function:

getBreadcrumbs (  ) 

Get the breadcrumbs trail leading up to this gallery

Returns:
An instance of the breadcrumbs class

Definition at line 692 of file gallery2.php.

References $i, edit, globalIDtoURL(), imageOrder, and title.

Referenced by render().

Here is the call graph for this function:

getGlobalID ( editingFunction  ) 

globalID_gallery2 ( splitID  ) 

Returns the url that corresponds to the globalID corresponding to a gallery item if appropriate

Parameters:
splitID The global ID to check
Returns:
string A string containing the URL corresponding to the globalID, if existing

Definition at line 2588 of file gallery2.php.

globalIDThumbnail_gallery2 ( splitID  ) 

Return an array of data about the thumbnail for a global ID

Parameters:
splitID The global ID to check
Returns:
Array containing array( "uri" => the fully qualified URI for the thumbnail, "width" => the width in pixels, "height" => the height in pixels )

Definition at line 2630 of file gallery2.php.

References images.

loadImages (  ) 

If you're simply showing the list of galleries (e.g. subgalleries), you don't want to have loaded the actual images' data. Do that here!

Todo:
FIXME Apparently... the first image doesn't exist... It certainly doesn't get a next image assigned, and the second image doesn't get a previous image assigned..

Definition at line 600 of file gallery2.php.

References imageOrder, and images.

Referenced by countSubImages().

loadSubgalleries (  ) 

Load the subgalleries contained within. You only want this information if you're actually showing the gallery

Definition at line 584 of file gallery2.php.

References $fp.

Referenced by countSubImages(), and optionSubgalleries().

modulesetup_gallery2 (  ) 

optionSubgalleries ( currentGallery = "",
level 
)

Get a list of all subgalleries contained inside a gallery, listed as options, greyed if not available (for one reason or another)

Parameters:
currentGallery The global ID of the current gallery (not selectable, for more or less obvious reasons)
level What level are we at (for indentation purposes)
Returns:
string containing the options listing (for putting into a select element)

Definition at line 758 of file gallery2.php.

References i18n(), imageOrder, loadSubgalleries(), and title.

Here is the call graph for this function:

parse_gallery2 ( page_data  ) 

Definition at line 2120 of file gallery2.php.

References allUsersArray(), globalIDtoURL(), i18n(), images, parse_userlists(), renderInformationBox(), and spotModuleCommand().

Here is the call graph for this function:

profilemodule_gallery2 (  ) 

Definition at line 2222 of file gallery2.php.

References $gallery, $tabwidget, edit, editLevel, getGlobalID(), globalIDtoURL(), and i18n().

Here is the call graph for this function:

render (  ) 

Render the gallery view

Returns:
String containing the rendered gallery

Definition at line 1761 of file gallery2.php.

References $meta_headers, $permissionlevels_array, description, edit, getBreadcrumbs(), getGlobalID(), globalIDtoURL(), i18n(), imageOrder, images, parse_page_data(), renderEditor(), renderInformationBox(), siteURL(), userCanView(), viewLevel, and viewType.

Here is the call graph for this function:

renderEditor (  ) 

Render the gallery editor

Returns:
String containing the rendered gallery editing system. This is always the verbose table view mode, with extra editing controls

Todo:
FIXME Move this functionality into a class of its own... We use it in a number of places, and only change a very few things... Might as well abuse that fact

Cropping method adopted from lixlpixel PHParadise

category : image editing

snippet : crop image

downloaded : 11.02.2005 - 16:27

file URL : http://www.fundisom.com/phparadise/php/image_editing/crop_image

Todo:
FIXME: Why the heck does move first image down not work?!

Definition at line 862 of file gallery2.php.

References $filename, $formatting_toolbar, $gallery, $gallery2_viewTypes, $message, $panel, $permissionlevels_array, $values, allUsersArray(), array_export(), baseurl, commentLevel, cropImage(), currentUser(), description, drawCommand(), editLevel, embedLevel, endKey(), formatTime(), generate_pagehelplink(), getGlobalID(), globalIDtoURL(), i18n(), imageOrder, images, render(), renderInformationBox(), save(), scaleImage(), title, viewLevel, and viewType.

Referenced by render().

Here is the call graph for this function:

save (  ) 

Save the gallery's options and descriptions and things

Returns:
true if successful, or an error message describing the error otherwise (for use with errorHandler)

Definition at line 657 of file gallery2.php.

References $gallery, array_export(), commentLevel, description, editLevel, embedLevel, imageOrder, title, viewLevel, and viewType.

Here is the call graph for this function:

userCanEdit (  ) 

Check wether the current user is allowed to edit this gallery

Returns:
Boolean value describing wether the user currently logged in is allowed to edit the gallery

Definition at line 813 of file gallery2.php.

References currentUser(), and editLevel.

Here is the call graph for this function:

userCanView (  ) 

Check wether the current user is allowed to view this gallery

Returns:
Boolean value describing wether the user currently logged in is allowed to edit the gallery

Definition at line 837 of file gallery2.php.

References currentUser(), and viewLevel.

Referenced by render().

Here is the call graph for this function:


Variable Documentation

else $filecontents = "No title\nNo description file found"

Definition at line 531 of file gallery2.php.

$gallery2_viewTypes[] = "table"

Definition at line 1909 of file gallery2.php.

Referenced by modulesetup_gallery2(), and renderEditor().

$gallery_options

Definition at line 39 of file gallery2.php.

$galleryinfobegpos = strpos( $filecontents, "\n" )

Definition at line 533 of file gallery2.php.

$modules[] = "parse_gallery2"

Definition at line 32 of file gallery2.php.

$modules_descriptions[] = "A simple but powerful gallery"

Definition at line 25 of file gallery2.php.

$modules_globalID[] = "globalID_gallery2"

Definition at line 30 of file gallery2.php.

$modules_names[] = "Gallery2"

New Gallery module for Travelsized CMS Based around the old gallery, but with a new, much improved (and much easier to maintain) code structure

Dan Jensen <admin@leinir.dk> 0.1 3rd Dec, 2006

The structure of a gallery is as follows below:

A gallery is a directory with...

  • gallery.txt A text file, containing the gallery's title and description, in the form of "title\ndescription" - deleted on first save
  • gallery.php A text file, containing the fallery's options and such, descriptions and likewise
  • comments/*.jpg/png/gif.inc A text file containing the exported comments data
  • images/*.jpg/png/gif The images themselves
  • data/*.language.txt Old data files, containing description - deleted on first save
  • data/*.language.php New data files, containing all sorts of options
  • thumbs/*.jpg/png/gif Thumbnail files
  • galleries/* Subgalleries

Definition at line 23 of file gallery2.php.

$modules_setup[] = "modulesetup_gallery2"

Definition at line 27 of file gallery2.php.

$modules_versions[] = "0.1"

Definition at line 24 of file gallery2.php.

$page_help["&#92;profilegallerylist(txt1)"] = "This will show a list of profiles where there is at least one image in the user's profile gallery. txt1 is optional, and is the style of listing. Defaults to three-up."

Definition at line 36 of file gallery2.php.

$page_help["&#92;galleryimage(txt1,txt2,txt3)"] = "This will show the image thumbnail for the image with the global ID txt1. If txt2 is present the image will be floated to the alignment as described. Accepted values are left, center and right. If you write anything at all as txt3, the shown thumbnail will not be linked to the midsize view. If omitted, the image will be linked."

Definition at line 35 of file gallery2.php.

$page_help["&#92;gallery(txt1)"] = "This will show the gallery with the global ID txt1."

Definition at line 34 of file gallery2.php.

$profilemodules[] = "profilemodule_gallery2"

Definition at line 29 of file gallery2.php.

this baseurl = $module_folder . "/gallery/"

Definition at line 464 of file gallery2.php.

Referenced by renderEditor().

this commentLevel = $gallery["commentLevel"]

this description = $gallery["description"]

this editLevel = $gallery["editLevel"]

this embedLevel = $gallery["embedLevel"]

Definition at line 480 of file gallery2.php.

Referenced by renderEditor(), and save().

this imageOrder = $gallery["imageOrder"]

Definition at line 481 of file gallery2.php.

Referenced by getBreadcrumbs(), loadImages(), optionSubgalleries(), render(), renderEditor(), and save().

this images = array()

this title = $gallery["title"]

this viewLevel = $gallery["viewLevel"]

this viewType = $gallery["viewType"]

Definition at line 474 of file gallery2.php.

Referenced by render(), renderEditor(), and save().


Generated on Sun Oct 26 20:33:14 2008 for The Travelsized Content Management System by  doxygen 1.5.5