Commit 6b9a901c authored by profix898's avatar profix898

- task: remove g2image related code

- task: cleanup help system and integration with advanced_help module
parent 0e695e18
......@@ -139,6 +139,12 @@ function gallery_update_6000() {
}
$new['gallery_block_num'] = $delta;
// Other variables
$migrate += array(
'gallery_g2image_only_listed_pages' => 'gallery_g2image_visibility',
'gallery_g2image_std_pages' => 'gallery_g2image_visibility_pages'
);
// Array containing obsolete variables
$obsolete = array(
'gallery_page_callback',
......
// $Id$
function g2image_open(field) {
// Set some properties
var form = $('#'+field).parents('form').attr('id');
var url = Drupal.settings.gallery.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);
}
}
......@@ -419,7 +419,7 @@ function gallery_filter($op, $delta = 0, $format = -1, $text = '') {
*/
function gallery_filter_tips($delta = 0, $format = -1, $long = FALSE) {
require_once(drupal_get_path('module', 'gallery') .'/gallery_help.inc');
return $long ? gallery_filter_long_tip_translated() : gallery_filter_short_tip_translated();
return $long ? gallery_help_filter_long_tip() : gallery_help_filter_short_tip();
}
/**
......
<?php
// $Id$
/**
* gallery.module : gallery_g2image.inc
* Support functions for g2image by capt_kirk (from http://g2image.steffensenfamily.com)
*/
/**
* Function gallery_g2image_add_js().
*/
function gallery_g2image_add_js() {
// Ensure only sent once
static $sent = FALSE;
if (!$sent) {
$path = drupal_get_path('module', 'gallery');
$g2image_uri = base_path() . $path .'/g2image/';
drupal_add_js(array('gallery' => array('g2image_uri' => $g2image_uri)), 'setting');
drupal_add_js($path .'/gallery.js');
$sent = TRUE;
}
}
/**
* 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="g2image_open(\''. $element['#id'] .'\');">';
$output .= t('Add Gallery2 images');
$output .= '</a></div>';
return $output;
}
/**
* 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() {
require_once(drupal_get_path('module', 'gallery') .'/gallery_help.inc');
$page_match = FALSE;
$only_listed_pages = variable_get('gallery_g2image_only_listed_pages', 1);
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;
}
......@@ -79,11 +79,10 @@ function _gallery_g2image_page_match() {
require_once(drupal_get_path('module', 'gallery') .'/gallery_help.inc');
$page_match = FALSE;
$only_listed_pages = variable_get('gallery_g2image_only_listed_pages', 1);
if ($pages = variable_get('gallery_g2image_std_pages', gallery_help('admin/settings/gallery_g2image#pages'))) {
$visibility = variable_get('gallery_g2image_visibility', 1);
if ($pages = variable_get('gallery_g2image_visibility_pages', "node/add/*\ncomment/*")) {
$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));
$page_match = !($visibility xor drupal_match_path($path, $pages));
}
return $page_match;
......
......@@ -63,26 +63,27 @@ function _gallery_g2image_settings() {
TinyMCE version will NOT work wih Safari - use the standalone version instead.'),
);
$form['g2image']['gallery_g2image_only_listed_pages'] = array(
$visibility = variable_get('gallery_g2image_visibility', 1);
$form['g2image']['gallery_g2image_visibility'] = array(
'#type' => 'radios',
'#title' => t('Show g2image link on specific pages (Standalone mode only)'),
'#default_value' => variable_get('gallery_g2image_only_listed_pages', 1),
'#title' => t('Show G2Image link on specific pages (Standalone mode)'),
'#default_value' => $visibility,
'#options' => array(
t('Show on every page except the listed pages.'),
t('Show on only the listed pages.')
)
);
require_once(drupal_get_path('module', 'gallery') .'/gallery_help.inc');
$form['g2image']['gallery_g2image_std_pages'] = array(
'#type' => 'textarea',
'#title' => t('Pages (Standalone mode only)'),
'#default_value' => variable_get('gallery_g2image_std_pages', gallery_help('admin/settings/gallery_g2image#pages')),
'#description' => t('Enter one page per line as Drupal paths. The \'*\' character is a wildcard. Example paths are
\'%blog\' for the blog page and %blog-wildcard for every personal blog. %front is the front page.',
array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>'))
);
if ($visibility) {
$form['g2image']['gallery_g2image_visibility_pages'] = array(
'#type' => 'textarea',
'#title' => t('Pages (Standalone mode only)'),
'#default_value' => variable_get('gallery_g2image_visibility_pages', "node/add/*\ncomment/*"),
'#description' => t('Enter one page per line as Drupal paths. The \'*\' character is a wildcard. Example paths are
\'%blog\' for the blog page and %blog-wildcard for every personal blog. %front is the front page.',
array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>'))
);
}
$form['g2image']['gallery_g2image_sortby'] = array(
'#type' => 'select',
'#title' => t('Default Sort Order'),
......
This diff is collapsed.
<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> <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> </p>
<ul>
<li>item_id (required): This is the item ID from Gallery2. If you look at the URL of the item, this is the last number. <em>Note that if the item_id is a single photo, n must be 1. </em></li>
<li>n (suggested): This is the number of photos you want the block to show. It will override whatever is set in the defaults (initially 1). Note: this will change past instances where you did not set n -- the reason for its suggested use.</li>
<li>type: The default type of gallery block. Any of the following may be used: <em>randomImage, recentImage, viewedImage, randomAlbum, recentAlbum, viewedAlbum, dailyImage, weeklyImage, monthlyImage, dailyAlbum, weeklyAlbum, monthlyAlbum, specificItem. </em> Note that for n=1, selectedItem is automatically chosen regardless of this parameter.</li>
<li>class: The block that Gallery2 returns is wrapped in a DIV so additional styling can be done. The classes for this DIV are located in g2_filter.css. Included with the module are "left", "right", and "nowrap". These position the image block to the left or right or on a line all its own with the text not wrapping. You can also add your own class(es) to the CSS file and they will automatically be available.</li>
<li>size: The length of the longest side for the thumbnail. The other side is determined automatically to keep the same aspect ratio. This option (for Gallery2.2 and above) will use the gallery image that is closest in size, and so may end up using a smaller image and expanding it (lower quality). If so, use "exactsize". For Gallery2.1, if you want your size to be bigger thanthe thumbnail size for that image as defined in your Gallery2, you must select "Full Size" inthe gallery settings page (but note that the full image will be returned and then resized by the browser, so it may take a while to download).</li>
<li>exactsize: The length of the longest side for the thumbnail. The other side is determined automatically to keep the same aspect ratio. This option always ensures that the image is scaled from a larger image and so image quality is maintained. This only works for Gallery2.2 and above.</li>
<li>frame/album_frame/item_frame: You can use just "frame" to assign a frame to the thumbnail regardless of whether it\'s for an album or a single item. Using aframe will only affect albums and iframe will only affect single items. Frames included with the default Gallery 2 install are: bamboo, book, brand , dots, flicking, gold, gold2, polaroid, polaroids, shadow, shells, slide, solid, notebook, wood.</li>
</ul>
[gallery-forms]
//site_name@system_site_information_settings=history
[filter]
title = Gallery2 Filter
file = filter-gallery
[install-directory]
title = Installation: Directory Settings
file = install-directory
//parent = about-php
<h3>Directory Settings</h3>
<p>"URI of Gallery2" is the URI of the Gallery2 standalone location. Path from docroot to the directory main.php is located. Protocol / host name are both optional. Examples: /gallery2/, /sub/gallery2/, http://photos.example.com/, www.example.com/photos/main.php </p>
<p>"Location of Gallery2" is the path of your gallery2 installation, either absolute (starts with "/") or relative to your Drupal installation directory. Normally this is auto-detected, but in case this fails you can turn off auto-detection and manually enter a value. </p>
<p>"Embed URI" is the URI needed to access Gallery2 through Drupal. This will end in \'?q=gallery\' (non-clean URLs) or \'gallery\' (clean URLs). Normally this is auto-detected, but in case this fails you can turn off auto-detection and manually enter a value. </p>
<p>Some examples: </p>
<p>Example 1: If your directory structure and website structure is
<ul>
<li>Drupal dir: /var/www/web/html/</li>
<li>Gallery dir: /var/www/web/html/gallery2/</li>
<li>Website URL: http://www.example.com</li>
<li>Standalone Gallery2 URL: http://www.example.com/gallery2/</li>
<li>Then
<ul>
<li>"URI of Gallery2" = "/gallery2/" or "http://www.example.com/gallery2/"</li>
<li>"Location of Gallery2" = "gallery2/" or "/var/www/web/html/gallery2/"</li>
<li>"Embed URI" = "?q=gallery" or "http://www.example.com/?q=gallery"</li>
</ul>
</ul>
</p>
<p>Example 2: If your directory structure and website structure is
<ul>
<li>Drupal dir: /var/www/web/html/drupal/</li>
<li>Gallery dir: /var/www/web/html/gallery2/</li>
<li>Website URL: http://www.example.com/drupal</li>
<li>Standalone Gallery2 URL: http://www.example.com/gallery2/</li>
<li>Then
<ul>
<li>"URI of Gallery2" = "/gallery2/" or "http://www.example.com/gallery2/"</li>
<li>"Location of Gallery2" = "../gallery2/" or "/var/www/web/html/gallery2/"</li>
<li>"Embed URI" = "/drupal/?q=gallery" or "http://www.example.com/drupal/?q=gallery"</li>
</ul>
</ul>
</p>
<p>Example 3: If your directory structure and website structure is
<ul>
<li>Drupal dir: /var/www/web/html/drupal/</li>
<li>Gallery dir: /var/www/web/html/someotherdir/gallery2/</li>
<li>Website URL: http://www.example.com/</li>
<li>Standalone Gallery2 URL: http://www.anotherexample.com/gallery2/</li>
<li>Then
<ul>
<li>"URI of Gallery2" = "http://www.anotherexample.com/gallery2/"</li>
<li>"Location of Gallery2" = "/var/www/web/html/someotherdir/gallery2/"</li>
<li>"Embed URI" = "/drupal/?q=gallery" or "http://www.example.com/drupal/?q=gallery"</li>
</ul>
</ul>
</p>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment