Commit 04b696f5 authored by kiz_0987's avatar kiz_0987

Syncing HEAD with DRUPAL-5.

parent 0eb7e5c4
......@@ -9,7 +9,7 @@ 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 4.7
Drupal 5.x
gallery.module
Note that this module does not provide any photo/album functions itelf, but uses
......@@ -18,7 +18,7 @@ Gallery2 (http://gallery.menalto.com) to provide this functionality.
Installation Instructions
-------------------------
1. Install Gallery 2.1 and Drupal 4.7 (see their respective installation
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
......
......@@ -13,7 +13,7 @@ Note that you will need to download and install Gallery2
Requirements
------------
* Gallery 2.1 or above (with ImageBlock and ImageFrame modules installed and activated)
* Drupal 4.7
* Drupal 5.x
For installation instructions please see INSTALL.txt
......
......@@ -26,11 +26,17 @@ function gallery_menu($may_cache) {
'access' => user_access('administer users'),
'type' => MENU_LOCAL_TASK,
);
$items[] = array(
'path' => 'admin/settings/gallery',
'title' => t('gallery'),
'description' => t('Settings for embedded Gallery2.'),
'callback' => 'drupal_get_form',
'callback arguments' => 'gallery_admin_settings',
'access' => user_access('administer site configuration'),
'type' => MENU_NORMAL_ITEM,
);
} else {
// Add head info here so that it is included once only per page
// May need modification once the merits/issues of theme_add_style are fully known
// See http://drupal.org/node/60096
theme_add_style(drupal_get_path('module', 'gallery') .'/drupal_g2.css');
drupal_add_css(drupal_get_path('module', 'gallery') .'/drupal_g2.css', 'module', 'all');
}
return $items;
}
......@@ -47,10 +53,10 @@ function gallery_help($section) {
/**
* Implementation of hook_settings
*/
function gallery_settings() {
function gallery_admin_settings() {
$path = drupal_get_path('module', 'gallery');
require_once($path . '/gallery_settings.inc');
return _gallery_settings();
return system_settings_form(_gallery_settings());
}
/**
......
......@@ -124,7 +124,7 @@ function gallery_get_language($user) {
// Added depdev patch for language support (http://drupal.org/node/32374)
// without i18 part (I seem to remember a Rewrite issue with it
// Added test for no user language defined
if (($user->uid==0 || !($user->language)) && module_exist('locale')) {
if (($user->uid==0 || !($user->language)) && module_exists('locale')) {
// This is a visitor and locale module is enabled
// Get drupal's default language
$result = db_query('SELECT locale, name FROM {locales_meta} WHERE isdefault = 1');
......
......@@ -195,7 +195,7 @@ function gallery_filter_process($text) {
if ($g2_head) {
gallery_set_html_head(implode("\n", array_unique($g2_head)));
}
theme_add_style(drupal_get_path('module', 'gallery') .'/gallery_filter.css');
drupal_add_css(drupal_get_path('module', 'gallery') .'/gallery_filter.css', 'module', 'all');
}
return $text . "<br class=\"giImageBlock-clear-both\" />";;
}
......
......@@ -12,20 +12,21 @@
function _gallery_help($section) {
switch($section) {
case 'admin/modules#description':
return t('Integration with Gallery2.1 (%gallery_url)', array('%gallery_url' => 'http://gallery.menalto.com/'));
case 'filter#short-tip' :
return gallery_filter_short_tip_translated();
case 'filter#long-tip' :
case 'admin/settings/modules#description':
return t('Integration with Gallery2.1 and above (%gallery_url)', array('%gallery_url' => 'http://gallery.menalto.com/'));
case 'filter#short-tip' :
return gallery_filter_short_tip_translated();
case 'filter#long-tip' :
return gallery_filter_long_tip_translated();
case 'admin/help#gallery_filter' :
return t('<p>Used to add image blocks from your embedded Gallery 2 to a node
like a blog entry or a story. To enable this feature and learn the proper syntax,
case 'admin/help#gallery_filter' :
return t('<p>Used to add image blocks from your embedded Gallery 2 to a node
like a blog entry or a story. To enable this feature and learn the proper syntax,
visit the <a href="%filters">filters configuration screen</a>.</p>',
array ('%filters' => url('admin/filters')));
array ('%filters' => url('admin/filters')));
case 'admin/help#gallery':
$output = t('
<p></p>
<h3>Online Documentation</h3>
<p>Complete documentation can be found on the <a href="http://drupal.galleryembedded.com">wiki</a>.</p>
<h3>Settings</h3>
<h4>Directory Settings</h4>
<p>"URI of Gallery2" is the URI of the Gallery2 standalone location. Path from docroot to the directory main.php is located.
......@@ -98,51 +99,51 @@ function _gallery_help($section) {
}
}
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')));
}
function gallery_filter_long_tip_translated() {
$prefix = variable_get("gallery_filter_prefix", "G2");
$output = "";
$output .= '<p><strong>Gallery2 Filter:</strong><p>You can link to items in your ';
$output .= 'embedded Gallery2 using a special code. ';
$output .= 'This code will be replaced by a thumbnail image that is ';
$output .= 'linked to the actual item in your Gallery. </p>';
$output .= '<p><em>Syntax:</em></p>';
$output .= '<blockquote><code>';
$output .= '['.$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>]';
$output .= '</code></blockquote>';
$output .= '<ul><li>item_id (required): This is the item ID from Gallery2. ';
$output .= '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> ';
$output .= '<li>n (suggested): This is the number of photos you want the block to show. ';
$output .= '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> ';
$output .= '<li>type: The default type of gallery block. Any of the following may be used: ';
$output .= '<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> ';
$output .= '<li>class: The block that Gallery2 returns is wrapped in a DIV so additional styling can be done. ';
$output .= 'The classes for this DIV are located in g2_filter.css. Included with the module ';
$output .= 'are "left", "right", and "nowrap". These position the image block to the left or ';
$output .= 'right or on a line all its own with the text not wrapping. You can also add your ';
$output .= 'own class(es) to the CSS file and they will automatically be available.</li> ';
$output .= '<li>size: The length of the longest side for the thumbnail. ';
$output .= 'The other side is determined automatically to keep the same aspect ratio.</li> ';
$output .= '<li>frame/album_frame/item_frame: You can use just "frame" to assign a frame ';
$output .= 'to the thumbnail regardless of whether it\'s for an album or a single item. ';
$output .= 'Using aframe will only affect albums and iframe will only affect single items. ';
$output .= 'Frames included with the default Gallery 2 install are: ';
$output .= 'bamboo, book, brand , dots, flicking, gold, gold2, polaroid, polaroids, shadow, ';
$output .= 'shells, slide, solid, notebook, wood.</li></p>';
return t($output);
}
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')));
}
function gallery_filter_long_tip_translated() {
$prefix = variable_get("gallery_filter_prefix", "G2");
$output = "";
$output .= '<p><strong>Gallery2 Filter:</strong><p>You can link to items in your ';
$output .= 'embedded Gallery2 using a special code. ';
$output .= 'This code will be replaced by a thumbnail image that is ';
$output .= 'linked to the actual item in your Gallery. </p>';
$output .= '<p><em>Syntax:</em></p>';
$output .= '<blockquote><code>';
$output .= '['.$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>]';
$output .= '</code></blockquote>';
$output .= '<ul><li>item_id (required): This is the item ID from Gallery2. ';
$output .= '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> ';
$output .= '<li>n (suggested): This is the number of photos you want the block to show. ';
$output .= '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> ';
$output .= '<li>type: The default type of gallery block. Any of the following may be used: ';
$output .= '<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> ';
$output .= '<li>class: The block that Gallery2 returns is wrapped in a DIV so additional styling can be done. ';
$output .= 'The classes for this DIV are located in g2_filter.css. Included with the module ';
$output .= 'are "left", "right", and "nowrap". These position the image block to the left or ';
$output .= 'right or on a line all its own with the text not wrapping. You can also add your ';
$output .= 'own class(es) to the CSS file and they will automatically be available.</li> ';
$output .= '<li>size: The length of the longest side for the thumbnail. ';
$output .= 'The other side is determined automatically to keep the same aspect ratio.</li> ';
$output .= '<li>frame/album_frame/item_frame: You can use just "frame" to assign a frame ';
$output .= 'to the thumbnail regardless of whether it\'s for an album or a single item. ';
$output .= 'Using aframe will only affect albums and iframe will only affect single items. ';
$output .= 'Frames included with the default Gallery 2 install are: ';
$output .= 'bamboo, book, brand , dots, flicking, gold, gold2, polaroid, polaroids, shadow, ';
$output .= 'shells, slide, solid, notebook, wood.</li></p>';
return t($output);
}
function _gallery_g2image_help() {
$output = '<h3>Gallery Image Assist (g2image)</h3>';
......
......@@ -81,7 +81,7 @@ function _gallery_settings() {
); */
// Fullname settings
if (module_exist('profile')) {
if (module_exists('profile')) {
$form['fullname'] = array(
'#type' => 'fieldset',
'#title' => t('Full Name settings'),
......@@ -778,12 +778,12 @@ function _gallery_links_settings() {
/**
* Validate the gallery form settings
*/
function gallery_settings_form_validate($form_id, &$form) {
function gallery_admin_settings_validate($form_id, &$form) {
global $form_values;
include_once(drupal_get_path('module', 'gallery') . '/G2EmbedDiscoveryUtilities.class');
include_once(drupal_get_path('module', 'gallery') . '/G2EmbedTestUtilities.class');
$gallery_valid = 1;
$gallery_valid = 1;
// Store the original values for the variables
$orig['g2Uri'] = $form_values['gallery_uri'];
......
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