Commit e65698fe authored by profix898's avatar profix898

- Update HEAD to 5.x-2.0 release version

parent ccec940e
// $Id$
kiz_0987:
This gallery.module was based on original code by walkah. The gallery_filter part is almost
entirely based on work by MichelleC and Waldemar. The g2image application is by capt_kirk.
Thanks for all your efforts.
MichelleC (g2_filter):
This module would not exist without image_filter by Eric Scouten (http://drupal.org/node/9707). I started with that module and transformed it bit by bit into this module. While there's not a lot of original code left, I wouldn't have been able to do this without using image_filter as a template.
This module is dependent on Drupal (of course), Gallery 2, and the gallery.module (http://drupal.org/project/gallery) so thanks to everyone for all the work on those. Without them, this module would be useless. :)
\ No newline at end of file
<?php
/*
* $RCSfile$
*
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2006 Bharat Mediratta
*
......@@ -464,4 +462,5 @@ class G2EmbedDiscoveryUtilities {
return true;
}
}
?>
\ No newline at end of file
?>
This diff is collapsed.
$Id$
HELP
----
For more help, check out: http://drupal.galleryembedded.com
Requirements
------------
Gallery2.1 (or above) installed and working (see http://gallery.menalto.com)
Image Block module installed and activated in Gallery2
Image Frame module installed and activated in Gallery2
Drupal 5.x
Gallery module (this Drupal module)
Note that this module does not provide any photo/album functions itelf, but uses
Gallery2 (http://gallery.menalto.com) to provide this functionality.
Installation Instructions
-------------------------
1. Install Gallery 2.1 and Drupal 5.x (see their respective installation
documents).
***Warning*** - Do not name your Gallery2 directory "gallery", call it something else
(eg "gallery2"). Calling it "gallery" will cause a conflict with the Drupal gallery.module
as Drupal assumes that http://www.example.com/gallery refers to the Drupal module.
2. Ensure that "Image Block" and "Image Frame" modules are installed and activated in Gallery2.
Check them in the non-embedded Gallery. See
http://codex.gallery2.org/index.php/Gallery2:Download for instructions to download it
if it was not included in your installation.
3. Log out of Gallery2 (non-embedded) - people have reported errors relating to sessions if this
is not done.
4. Copy the entire gallery module directory to your Drupal modules/ directory.
5. Enable the gallery module in Administer -> Site building -> Modules in your Drupal
installation.
6. Go to Administer -> Site configuration -> Gallery and enter the URI of Gallery2.
Leave "autodetect" selected and click "Save configuration". A series of tests will run to check
if everything is OK. There is a HELP link.
7. Enable the "Gallery Block" in Administer -> Site building -> Blocks, and optionally the
"Gallery Navigation" block and the "Gallery Grid Block".
8. Enable the "Access Gallery" permission for the roles that you want to be able to see the gallery
and gallery blocks. Go to Administer -> User management -> Access control.
9. If necessary, disable the Register module in Gallery2 and remove the Login item from the sidebar
block. All login and registration functions now need to go through Drupal (and from there
automatically to Gallery2, not Gallery2 directly.)
Optional Steps
--------------
1. Sidebar. Go to your Gallery2 site admin and include the blocks you want in the sidebar
(under Themes). I use "Item Actions" and "Album Quick Links (DHTML)". To use
the latter you need to have installed the Album Select module.
2. URL Rewrite.
3. g2image. If you install g2image http://g2image.steffensenfamily.com as either a standalone or
TinyMCE plugin you will have an excellent image chooser for Drupal/Gallery2. The
configuration is automatic when you hit the "Save configuration' button on the gallery
settings page.
Troubleshooting
---------------
See http://drupal.galleryembedded.com
\ No newline at end of file
$Id$
// $Id$
Overview
---------
This module embeds Gallery2 (http://gallery.menalto.com) inside your drupal installation
to support photos, videos and other content. There is support for 2 types of image block (can be
placed in the sidebar) and a navigation menu, inserting of images into nodes via an input filter,
TinyMCE support, syncing of users between the 2 applications, ...
This module embeds Gallery2 (http://gallery.menalto.com) inside your Drupal
installation to support photos, videos and other content. There is support for
2 types of image blocks and a navigation menu, inserting of images into nodes
via an input filter, TinyMCE support, syncing of users between the two
applications, ...
Note that you will need to download and install Gallery2
(http://codex.gallery2.org/index.php/Gallery2:Download) prior to installing this module.
Note that you will need to download and install Gallery2
(http://gallery.menalto.com/downloads) prior to installing this module.
Requirements
------------
* Gallery 2.1 or above (with ImageBlock and ImageFrame modules installed and activated)
* Gallery 2.2
* Drupal 5.x
For installation instructions please see INSTALL.txt
Installation
------------
1. Install Gallery 2 and Drupal (see their respective installation documents).
Gallery2 should be *inside* your Drupal installation so that it's accessible
by the same website. If you installed Gallery somewhere else, you can create
a symlink to it from inside your Drupal site or you can move Gallery2.
Warning - Do not name your G2 directory 'gallery', call it something else
(e.g. 'gallery2'). Calling it 'gallery' will cause a conflict with the Drupal
gallery.module as Drupal assumes that http://www.example.com/gallery refers
to the Drupal module.
2. Ensure that 'Image Block' and 'Image Frame' plugins are installed and
activated in Gallery2. Check them in the non-embedded Gallery.
3. Log out of Gallery 2 (non-embedded) - people have reported errors relating
to sessions if this is not done.
4. Copy gallery.module to your Drupal modules/ directory.
5. Enable the gallery module in Administer -> Site building -> Modules in
your Drupal installation (admin/build/modules).
6. Go to Administer -> Site configuration -> Gallery (admin/settings/gallery)
and configure the path to your Gallery2 installation using the install wizard
provided there.
7. Enable the 'Gallery Block' in Administer -> Site building -> Blocks
(admin/build/block).
- Optional -
8. The Gallery user administration is now available in Administer -> User
management -> Gallery users (admin/user/gallery). You should at least check
the 'User settings' (admin/user/gallery/settings).
9. G2Image:
If you install G2Image (http://g2image.steffensenfamily.com) as either a
standalone or TinyMCE plugin you will have an excellent image chooser for
Drupal/Gallery2. The configuration is automatic when you hit the 'Save
configuration' button on the G2Image settings page
(admin/settings/gallery/g2image).
Support
-------
Please post bug reports and feature requests in the Issues tracker
(http://drupal.org/project/issues/gallery), support requests should generally
go to the Gallery 2 Integrations Forums (http://gallery.menalto.com/forum/78)
first.
Authors
-------
James Walker <walkah@walkah.net>
Kieran Parsons <kiz_0987@yahoo.com>
Thilo Wawrzik <drupal@profix898.de>
// $Id$
function g2ic_open(field) {
// Find the form id by going back through the hierarchy. Kludge until can get the form id
// directly from drupal.
var element = document.getElementById(field).parentNode;
while (element.tagName != 'FORM') {
element = element.parentNode;
}
var form = element.id;
var url = G2IMAGE_URI + 'g2image.php?g2ic_form='+form+'&g2ic_field='+field+'&g2ic_tinymce=0';
function g2image_open(field) {
// Set some properties
var form = $('#'+field).parents('form').attr('id');
var url = G2IMAGE_URI+'g2image.php?g2ic_form='+form+'&g2ic_field='+field+'&g2ic_tinymce=0';
var name = 'g2image';
var w = 600;
var h = 600;
var valLeft = (screen.width) ? (screen.width-w)/2 : 0;
var valTop = (screen.height) ? (screen.height-h)/2 : 0;
var features = 'width='+w+',height='+h+',left='+valLeft+',top='+valTop+',resizable=1,scrollbars=1';
// Open the G2Image window
window.open(url, name, features);
}
// BUEditor
function g2bueditor_open() {
if (editor.active) {
g2image_open(editor.active.textArea.id);
}
}
......@@ -4,24 +4,61 @@
* Drupal embeded Gallery2 css overrides.
* These do not make a perfect theme, but are not bad as a first step.
*/
/* Increase font size */
#gallery {
font-size: 100%;
}
/* Increase font size */
#gallery {
font-size: 100%;
}
/* Remove the header */
#gsHeader {
display: none;
}
/* Removes the Gallery Title (as Drupal displays it)*/
/* Removes the Gallery Title (as Drupal displays it) */
#gallery .gbBlock table h2 {
display: none;
display: none;
}
/* Drupal 5.x system.css adds a border to tbody */
#gallery tbody {
border-top: none;
}
/* Garland adds a width: 100% to all tables */
td.giAlbumCell table, td.giItemCell table {
width: auto;
}
/* Garland adds td and th padding which needs to be removed for imageframes.
Have to manually add each imageframe type -- annoying. */
table.ImageFrame_bamboo, table.ImageFrame_bamboo td,
table.ImageFrame_book, table.ImageFrame_book td,
table.ImageFrame_brand, table.ImageFrame_brand td,
table.ImageFrame_dotapple, table.ImageFrame_dotapple td,
table.ImageFrame_filmedges, table.ImageFrame_filmedges td,
table.ImageFrame_flicking, table.ImageFrame_flicking td,
table.ImageFrame_gold, table.ImageFrame_gold td,
table.ImageFrame_gold2, table.ImageFrame_gold2 td,
table.ImageFrame_notebook, table.ImageFrame_notebook td,
table.ImageFrame_notebooksquare, table.ImageFrame_notebooksquare td,
table.ImageFrame_photocorners, table.ImageFrame_photocorners td,
table.ImageFrame_photocorners_small, table.ImageFrame_photocorners_small td,
table.ImageFrame_polaroid, table.ImageFrame_polaroid td,
table.ImageFrame_polaroids, table.ImageFrame_polaroids td,
table.ImageFrame_postage, table.ImageFrame_postage td,
table.ImageFrame_shell, table.ImageFrame_shell td,
table.ImageFrame_shadow, table.ImageFrame_shadow td,
table.ImageFrame_slide, table.ImageFrame_slide td,
table.ImageFrame_slidesquare, table.ImageFrame_slidesquare td,
table.ImageFrame_wood, table.ImageFrame_wood td {
width: auto;
padding: 0px;
}
/* Brings h2 back for siteAdmin pages */
#siteAdminForm .gbBlock h2 {
display: block;
display: block;
}
/* Do not display the breadcrumb */
......@@ -29,18 +66,31 @@
display: none;
}
/* The system links ("Site Admin", "Your Album") should no longer float as the
/* The system links ("Site Admin", "Your Album") should no longer float as the
breadcrumb has been removed. Just align right */
#gsNavBar div.gbSystemLinks {
text-align: right;
float: none;
}
/* .block-gallery is in the sidebar */
/* .block-gallery is in the sidebar */
.block-gallery #gsSidebar {
border: none;
width: auto;
overflow: hidden;
border: none;
width: auto;
overflow: hidden;
}
/* Flatten left margin for SiteAdminLinks if moved to Drupal sidebar */
.block-gallery #gsSidebar ul#gbSiteAdminLinks,
.block-gallery #gsSidebar ul#gbSiteAdminLinks li,
.block-gallery #gsSidebar ul#gbSiteAdminLinks li ul,
.block-gallery #gsSidebar ul#gbSiteAdminLinks li ul li {
margin-left: 2px;
}
/* Remove bold font from SiteAdminLinks if moved to Drupal sidebar */
.block-gallery #gsSidebar #gbSiteAdminLinks a {
font-weight: normal;
}
.block-gallery div.block-core-ItemLinks {
......@@ -49,24 +99,33 @@
}
.block-gallery .gbBlock {
padding: 0 5px 3px 5px;
padding: 0 5px 3px 5px;
}
/* Drupal 5.x system.css adds a border to tbody */
.block-gallery tbody {
border-top: none;
}
/* Garland adds padding which needs to be removed */
.block-gallery td, th {
padding: 0;
}
/* Navigation Tree */
.block-gallery .dtree {
font-size: 1em;
font-size: 1em;
}
/* For g2ic_plugin */
img.g2image_float_left, div.g2image_float_left
{
/* For G2Image */
img.g2image_float_left, div.g2image_float_left {
float: left;
margin: 4px;
margin: 0px 4px 4px 0px;
}
img.g2image_float_right, div.g2image_float_right {
float: right;
margin: 4px;
margin: 0px 4px 4px 0px;
}
img.g2image_centered, div.g2image_centered {
......@@ -76,40 +135,38 @@ img.g2image_centered, div.g2image_centered {
text-align: center;
}
/* Neeed to centre images with frames */
/* Need to center images with frames */
.g2image_centered table {
margin: auto;
}
.g2image_clear_images {
clear: both;
}
}
.post-content img
{
float: left;
clear: both;
margin: 4px;
.post-content img {
float: left;
clear: both;
margin: 4px;
}
.page-content img
{
float: left;
clear: both;
margin: 4px;
.page-content img {
float: left;
clear: both;
margin: 4px;
}
/* Embed success, warning, error messages */
.g2_embed_success {
color: green;
color: #008800;
}
.g2_embed_warning {
color: #f63;
color: #f63;
}
.g2_embed_error {
color: red;
font-weight: bold;
color: #880000;
font-weight: bold;
}
/* Gallery Grid Block */
......@@ -144,6 +201,11 @@ margin: 4px;
margin: 1px;
}
/* Drupal 5.x system.css adds a border to tbody */
.gallery-grid-block tbody {
border-top: none;
}
td.gallery-grid-block {
text-align:center;
}
......@@ -153,9 +215,11 @@ td.gallery-grid-block {
margin: auto;
}*/
/* Garland adds padding which needs to be removed */
.gallery-grid-block table,
.gallery-grid-block .one-image td,
.gallery-grid-block .one-image td,
.gallery-grid-block .one-image table {
padding: 0;
margin: auto;
}
......
; $Id$
name = Gallery
description = Embeds Gallery2 into Drupal.
name = "Gallery"
description = "Embeds Gallery2 into Drupal."
package = "Gallery2"
<?php
// $Id$
/**
* gallery.module : gallery.install
* Install/Uninstall functions
*/
/**
* Implementation of hook_install().
*/
function gallery_install() {
}
/**
* Implementation of hook_update_N().
* Migrate settings from the 5.x-1.x to 5.x-2.x series
*/
function gallery_update_1() {
// Array containing 'old name' => 'new name' map
$migrate = array(
// Image block settings
'gallery_album_frame' => 'gallery_block_image_0_album_frame',
'gallery_block_block' => 'gallery_block_image_0_block_block',
'gallery_block_show' => 'gallery_block_image_0_block_show',
'gallery_item_frame' => 'gallery_block_image_0_item_frame',
'gallery_item_id' => 'gallery_block_image_0_item_id',
'gallery_link_target' => 'gallery_block_image_0_link_target',
'gallery_block_num_images' => 'gallery_block_image_0_num_images',
'gallery_maxsize' => 'gallery_block_image_0_size',
// Grid block settings
'gallery_grid_album_frame' => 'gallery_block_grid_0_album_frame',
'gallery_grid_block_block' => 'gallery_block_grid_0_block_block',
'gallery_grid_block_show' => 'gallery_block_grid_0_block_show',
'gallery_grid_item_frame' => 'gallery_block_grid_0_item_frame',
'gallery_grid_item_id' => 'gallery_block_grid_0_item_id',
'gallery_grid_link_target' => 'gallery_block_grid_0_link_target',
'gallery_grid_maxsize' => 'gallery_block_grid_0_size',
'gallery_grid_num_cols' => 'gallery_block_grid_0_num_cols',
'gallery_grid_num_rows' => 'gallery_block_grid_0_num_rows',
// G2 filter settings
'gallery_filter_default_size' => 'gallery_filter_default_maxsize',
// Search settings
'gallery_search_max_rows_per_pager' => 'gallery_search_rows_per_pager',
'gallery_search_maxsize' => 'gallery_search_size',
// Fullname support
'gallery_use_full_name' => 'gallery_use_fullname',
'gallery_profile_full_name_field' => 'gallery_profile_fullname_field'
);
// Array containing obsolete variables
$obsolete = array('gallery_search_max_items', 'gallery_autodetect_dir', 'gallery_uri', 'gallery_dir');
// Update variables
$ret = gallery_update_variables($migrate, $obsolete);
// Update the blocks
$ret[] = update_sql("UPDATE {blocks} SET delta = 'image-0' WHERE module = 'gallery' AND delta = 0");
$ret[] = update_sql("UPDATE {blocks} SET delta = 'navigation' WHERE module = 'gallery' AND delta = 1");
$ret[] = update_sql("UPDATE {blocks} SET delta = 'grid-0' WHERE module = 'gallery' AND delta = 2");
// Mark gallery configuration invalid. This does NOT reset the configuration, but
// forces the user to run the install wizard to (re)set and verify critical settings.
variable_set('gallery_valid', FALSE);
variable_set('gallery_config_reset', TRUE);
drupal_set_message('You were updating from gallery module 5.x-1.x (or earlier) to the 5.x-2.x
series of the module. All your settings were migrated automatically (see below),
but you will need to re-configure some basic options. Please visit the
Gallery settings page (admin/settings/gallery) to complete the update.',
'error');
cache_clear_all('variables', 'cache');
menu_rebuild();
return $ret;
}
/**
* Function gallery_update_variables().
*/
function gallery_update_variables($migrate, $obsolete) {
$ret = array();
$variables = array();
// Fetch all gallery-related variables
$result = db_query("SELECT * FROM {variable} WHERE name LIKE 'gallery_%'");
while ($var = db_fetch_object($result)) {
$variables[$var->name] = $var->value;
}
// Remove old variables
db_query("DELETE FROM {variable} WHERE name LIKE 'gallery_%'");
// Migrate old variables
foreach ($migrate as $old => $new) {
if (isset($variables[$old])) {
$variables[$new] = $variables[$old];
unset($variables[$old]);
$ret[] = array('success' => TRUE, 'query' => 'Migrating variable ['. $old .' => '. $new .']');
}
}
// Unset obsolete variables
foreach ($obsolete as $var) {
if (isset($variables[$var])) {
unset($variables[$var]);
$ret[] = array('success' => TRUE, 'query' => 'Removing variable ['. $var .']');
}
}
// Save resulting variables array
// (all variables not migrated or unset are taken over directly)
foreach ($variables as $name => $value) {
// We dont use variable_set() to reduce overhead
// (i.e. unserialize => serialize and cache_clear_all() for each variable)
db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", $name, $value);
}
return $ret;
}
/**
* Implementation of hook_uninstall().
*/
function gallery_uninstall() {
// Remove all gallery related variables and blocks
db_query("DELETE FROM {variable} WHERE name LIKE 'gallery_%'");
db_query("DELETE FROM {blocks} WHERE module = 'gallery'");
cache_clear_all('variables', 'cache');
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* $Id$ */
div.giImageBlock.left {
float: left;
margin: 1em;
}
div.giImageBlock.right {
float: right;
margin: 1em;
}
div.giImageBlock.nowrap {
float: none;
margin: 1em
div.giImageBlock.left {
float: left;
margin: 1em;
}
.giImageBlock-clear-both {
clear: both;
div.giImageBlock.right {
float: right;
margin: 1em;
}
div.giImageBlock.nowrap {
float: none;
margin: 1em
}
.giImageBlock-clear-both {
clear: both;
}
This diff is collapsed.
......@@ -5,58 +5,55 @@
* gallery.module : gallery_g2image.inc
* Support functions for g2image by capt_kirk (from http://g2image.steffensenfamily.com)
*/
/**
* Add js to page
/**
* Function gallery_g2image_add_js().
*/
function gallery_g2image_add_js() {
function gallery_g2image_add_js() {
// Ensure only sent once
static $sent = false;
static $sent = FALSE;
if (!$sent) {
$path = drupal_get_path('module', 'gallery');
$g2image_uri = base_path() . $path . '/g2image/';
$output .= '<script type="text/javascript">';
$output .= ' var G2IMAGE_URI = "' . $g2image_uri . '";';
$output .= '</script>';
$g2image_uri = base_path() . $path .'/g2image/';
drupal_add_js('var G2IMAGE_URI = "'. $g2image_uri .'";', 'inline');
drupal_add_js($path .'/g2image.js');
drupal_set_html_head($output);
drupal_add_js($path . '/g2image.js');
$sent = true;
$sent = TRUE;
}
}
/**
* Theme for adding an image link underneath textareas
/**
* Theme function : theme_gallery_g2image_textarea_link().
* (for adding an image link underneath textareas)
*/
function theme_gallery_g2image_textarea_link($element, $link) {
$output = '<div class="g2image-button"><a class="g2image-link" id="g2image-link-'. $element['#id']
. '" title="'. t('Click here to add images from Gallery2 albums')
. '" href="#" onclick="g2ic_open(\''.$element['#id'].'\');">';
$output .= t('add Gallery2 images');
.'" title="'. t('Click here to add images from Gallery2 albums')
.'" href="#" onclick="g2image_open(\''. $element['#id'] .'\');">';
$output .= t('Add Gallery2 images');
$output .= '</a></div>';
return $output;
}
/**
* Determine if g2image button should be attached to the page/textarea.
* (from img_assist and tinymce code)
* Function _gallery_g2image_page_match().
* (determine if g2image button should be attached to the page/textarea)
*
* @return
* TRUE if can render, FALSE if not allowed.
*/
function _gallery_g2image_page_match() {
//if (variable_get('gallery_g2image_std_all', 1)) {
require_once(drupal_get_path('module', 'gallery') .'/gallery_help.inc');
$page_match = FALSE;
$only_listed_pages = variable_get('gallery_g2image_only_listed_pages', 1);
$pages = variable_get('gallery_g2image_std_pages', gallery_help('admin/settings/gallery_g2image#pages'));
if ($pages) {
if ($pages = variable_get('gallery_g2image_std_pages', gallery_help('admin/settings/gallery_g2image#pages'))) {
$path = drupal_get_path_alias($_GET['q']);
$regexp = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1'. variable_get('site_frontpage', 'node') .'\2'), preg_quote($pages, '/')) .')$/';
$page_match = !($only_listed_pages xor preg_match($regexp, $path));
}
return $page_match;
}
?>
\ No newline at end of file
This diff is collapsed.
......@@ -7,15 +7,14 @@
*/
/**
* Implementation of hook_help
* Implementation of hook_help().
*/
function _gallery_help($section) {
switch($section) {
case 'filter#short-tip' :
return gallery_filter_short_tip_translated();
case 'filter#long-tip' :
return gallery_filter_long_tip_translated();
switch ($section) {
case 'filter#short-tip' :
return gallery_filter_short_tip_translated();
case 'filter#long-tip' :
return gallery_filter_long_tip_translated();
case 'admin/help#gallery':
$output = t('
<h3>Online Documentation</h3>
......@@ -81,37 +80,52 @@ function _gallery_help($section) {
}
}
/**
* Function gallery_filter_short_tip_translated().
*/
function gallery_filter_short_tip_translated() {
return t('You may link to Gallery2 items on this site <a href="@explanation-url">using a special syntax</a>.', array ('@explanation-url' => url('filter/tips', NULL, 'filter-gallery-0')));
return t('You may link to Gallery2 items on this site <a href="@explanation-url">using a special syntax</a>.', array('@explanation-url' => url('filter/tips', NULL, 'filter-gallery-0')));
}
/**
* Function gallery_filter_long_tip_translated().
*/
function gallery_filter_long_tip_translated() {
$prefix = variable_get("gallery_filter_prefix", "G2");
$prefix = variable_get("gallery_filter_prefix", "G2");
return t('
<p><strong>Gallery2 Filter:</strong></p>
<p><strong>Gallery2 Filter:</strong></p>
<p>You can link to items in your embedded Gallery2 using a special code. This code will be replaced by a thumbnail image that is linked to the actual item in your Gallery. </p>
<p><em>Syntax:</em></p>
<p><em>Syntax:</em></p>
<blockquote><code>
['. $prefix .':<em>item_id</em> n=<em>number</em> type=<em>type</em> size=<em>number</em> class=<em>name</em> frame=<em>name</em> album_frame=<em>name</em> item_frame=<em>name</em>]
</code></blockquote>
<blockquote><code>