Commit 36107bbe authored by Fernando Conceição's avatar Fernando Conceição

Commiting the current work in porting to drupal 7, the previous commit was wrong(my bad git skills)

parent 5cf2f3a6
......@@ -16,7 +16,7 @@ Not tested
To do
* Add a description in hook_permission
* There is is many filters without any action, look if this is really necessary,
* This is many filters without any action, look if this is really necessaary,
if not, remove the ones without action
\ No newline at end of file
/* $Id: lightbox-rtl.css,v 1.1.2.18 2010/06/07 14:43:02 snpower Exp $ */
#imageData #imageDetails {
float: right;
......
/* $Id: lightbox.css,v 1.1.4.28 2010/09/22 10:47:15 snpower Exp $ */
#lightbox {
position: absolute;
top: 40px;
......@@ -39,7 +40,7 @@
position: absolute;
top: 40%;
left: 45%;
*left: 0%;
/* left: 0%; */
}
#hoverNav {
......
/* $Id: lightbox_alt.css,v 1.1.4.22 2010/09/22 10:47:15 snpower Exp $ */
/**
* Based on a design created by Nicolas Borda:
* http://www.ipwa.net/assets/myslimbox/
......
/* $Id: lightbox_lite-rtl.css,v 1.1.2.6 2010/06/07 14:54:30 snpower Exp $ */
#lightbox {
background-color: #eee;
padding: 10px;
......
/* $Id: lightbox_lite.css,v 1.1.4.11 2010/06/07 14:54:30 snpower Exp $ */
#lightbox {
background-color: #eee;
padding: 10px;
......
/* $Id: auto_image_handling.js,v 1.1.4.33 2010/09/22 21:07:57 snpower Exp $ */
// Image Node Auto-Format with Auto Image Grouping.
// Original version by Steve McKenzie.
......
/* $Id: lightbox.js,v 1.5.2.6.2.136 2010/09/24 08:39:40 snpower Exp $ */
/**
* jQuery Lightbox
......@@ -15,7 +16,7 @@
*
* Slideshow, iframe and video functionality added by Stella Power.
*/
(function($) {
var Lightbox = {
auto_modal : false,
overlayOpacity : 0.8, // Controls transparency of shadow overlay.
......@@ -1155,12 +1156,13 @@ var Lightbox = {
return (jQuery.inArray(key, keys) != -1 || jQuery.inArray(String(code), keys) != -1);
},
filterXSS: function(str) {
filterXSS: function(str, allowed_tags) {
var output = "";
$.ajax({
url: Drupal.settings.basePath + 'system/lightbox2/filter-xss',
data: {
'string' : str
'string' : str,
'allowed_tags' : allowed_tags
},
type: "POST",
async: false,
......@@ -1175,7 +1177,9 @@ var Lightbox = {
};
// Initialize the lightbox.
Drupal.behaviors.initLightbox = function (context) {
Drupal.behaviors.initLightbox = {
attach: function(context) {
$('body:not(.lightbox-processed)', context).addClass('lightbox-processed').each(function() {
Lightbox.initialize();
return false; // Break the each loop.
......@@ -1184,5 +1188,6 @@ Drupal.behaviors.initLightbox = function (context) {
// Attach lightbox to any links with lightbox rels.
Lightbox.initList(context);
$('#lightboxAutoModal', context).triggerHandler('click');
}
};
})(jQuery);
/* $Id: lightbox2.js,v 1.1.4.39 2010/06/07 15:24:24 snpower Exp $ */
function alt_layout_handler(event) {
if ($("input[name=lightbox2_lite]:checked").val() != 1) {
......
/* $Id: lightbox_lite.js,v 1.1.2.2.2.19 2010/06/07 14:54:30 snpower Exp $ */
/**
* Lightbox JS: Fullsize Image Overlays
......
// $Id: lightbox_modal.js,v 1.1.2.5 2010/06/07 17:22:03 snpower Exp $
function lightbox2_login() {
(function ($) {
$("a[href*='/user/login'], a[href*='?q=user/login']").each(function() {
$(this).attr({
href: this.href.replace(/user\/login?/,"user/login/lightbox2"),
......@@ -7,9 +9,11 @@ function lightbox2_login() {
});
$(this).addClass('lightmodal-login');
});
})(jQuery);
}
function lightbox2_contact() {
(function ($) {
$("a[href$='/contact'], a[href$='?q=contact']").each(function() {
if (!this.href.match('admin/build/contact')) {
$(this).attr({
......@@ -19,14 +23,17 @@ function lightbox2_contact() {
$(this).addClass('lightmodal-contact');
}
});
})(jQuery);
}
Drupal.behaviors.initLightboxModal = function (context) {
if (Drupal.settings.lightbox2.enable_login) {
lightbox2_login();
}
if (Drupal.settings.lightbox2.enable_contact) {
lightbox2_contact();
Drupal.behaviors.initLightboxModal = {
attach: function(context, settings) {
if (settings.lightbox2.enable_login) {
lightbox2_login();
}
if (settings.lightbox2.enable_contact) {
lightbox2_contact();
}
}
};
/* $Id: lightbox_video.js,v 1.1.4.20 2010/09/21 17:57:22 snpower Exp $ */
/**
* Lightbox video
......
<?php
// $Id: lightbox2-insert-image.tpl.php,v 1.1.2.2 2010/09/22 10:16:30 snpower Exp $
/**
* @file
......
<?php
// $Id: lightbox2.admin.inc,v 1.1.2.38 2010/09/24 08:41:02 snpower Exp $
/**
* @file
......@@ -797,9 +798,10 @@ function lightbox2_auto_image_handling_settings_form() {
'#default_value' => variable_get('lightbox2_image_node', 0),
);
/*
// Add drop-down for list of available image sizes.
if (module_exists('image')) {
$sizes = _image_get_sizes();
$sizes = image_get_sizes();
foreach ($sizes as $size_key => $size) {
if ($size_key == 'original' or $size_key == '_original') {
$size_key = 'original';
......@@ -824,6 +826,7 @@ function lightbox2_auto_image_handling_settings_form() {
);
}
*/
// Add checkbox for disabling lightbox for gallery lists.
$form['handler_options']['image_node_options']['lightbox2_disable_nested_galleries'] = array(
......
<?php
// $Id: lightbox2.formatter.inc,v 1.1.2.30 2010/09/22 10:47:15 snpower Exp $
/**
* @file
......@@ -20,10 +21,15 @@
* @return
* HTML output for displaying the image.
*/
function theme_lightbox2_image($path, $alt = '', $title = '', $attributes = array()) {
$attributes_html = drupal_attributes($attributes);
$image = '<img src="'. file_create_url($path) .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $attributes_html .' />';
return $image;
function theme_lightbox2_image($variables) {
$path = $variables['path'];
$item = $variables['item'];
$image_style = $variables['image_style'];
$path['options']['attributes']['rel'] = 'lightbox';
$path['options']['attributes']['title'] = $item['alt'];
return theme('image_formatter', array( 'item' => $item, 'path' => $path, 'image_style' => $image_style ) );
}
/**
......@@ -37,9 +43,10 @@ function theme_lightbox2_image($path, $alt = '', $title = '', $attributes = arra
* @return
* HTML output for displaying the image and link.
*/
function theme_lightbox2_formatter_imagefield($element) {
if (!module_exists("imagecache") || !module_exists("imagefield")) {
return;
function theme_lightbox2_formatter_imagefield($variables) {
$element = $variables['element'];
if (!module_exists("image")) {
return;
}
$field_name = $element['#field_name'];
......@@ -73,7 +80,13 @@ function theme_lightbox2_formatter_imagefield($element) {
* @return
* The themed imagefield + imagecache image and link.
*/
function lightbox2_imagefield_image_imagecache($field_name, $item, $formatter, $node, $view_preset, $lightbox_preset, $args = array()) {
function lightbox2_imagefield_image_imagecache($variables) {
$field_name = $variables['field_name'];
$item = $variables['item'];
$formatter = $variables['formatter'];
$node = $variables['node'];
$view_preset = $variables['view_preset'];
$lightbox_preset = $variables['lightbox_preset'];
// Load file data if missing
if (!isset($item['filepath']) && !empty($item['fid'])) {
$file = field_file_load($item['fid']);
......@@ -115,7 +128,7 @@ function lightbox2_imagefield_image_imagecache($field_name, $item, $formatter, $
if ($lightbox_type == 'lightbox2_compact') {
$args['compact'] = TRUE;
}
return theme('imagefield_image_imagecache_lightbox2', $view_preset, $field_name, $item, $node, $rel, $args);
return theme('imagefield_image_imagecache_lightbox2', array( 'view_preset' => $view_preset, 'field_name' => $field_name, 'item' => $item, 'node' => $node, 'rel' => $rel, 'args' => $args ) );
}
}
......@@ -140,7 +153,13 @@ function lightbox2_imagefield_image_imagecache($field_name, $item, $formatter, $
* @return
* The themed imagefield + imagecache image and link.
*/
function theme_imagefield_image_imagecache_lightbox2($view_preset, $field_name, $item, $node, $rel = 'lightbox', $args = array()) {
function theme_imagefield_image_imagecache_lightbox2($variables) {
$view_preset = $variables['view_preset'];
$field_name = $variables['field_name'];
$item = $variables['item'];
$node = $variables['node'];
$rel = $variables['rel'];
$args = $variables['args'];
if (!isset($args['lightbox_preset'])) {
$args['lightbox_preset'] = 'original';
}
......@@ -251,14 +270,14 @@ function theme_imagefield_image_imagecache_lightbox2($view_preset, $field_name,
$image = '';
}
elseif ($view_preset == 'original') {
$image = theme('lightbox2_image', $item['filepath'], $image_tag_alt, $image_tag_title, $attributes);
$image = theme('lightbox2_image', array( 'path' => $item['filepath'], 'alt' => $image_tag_alt, 'title' => $image_tag_title, 'attributes' => $attributes ) );
}
elseif ($view_preset == 'link') {
// Not actually an image, just a text link.
$image = variable_get('lightbox2_view_image_text', 'View image');
}
else {
$image = theme('imagecache', $view_preset, $item['filepath'], $image_tag_alt, $image_tag_title, $attributes);
$image = theme('imagecache', array( 'style_name' => $view_preset, 'path' => $item['filepath'], 'alt' => $image_tag_alt, 'title' => $image_tag_title, 'attributes' => $attributes ) );
}
if ($args['lightbox_preset'] == 'node') {
......@@ -270,7 +289,6 @@ function theme_imagefield_image_imagecache_lightbox2($view_preset, $field_name,
else {
$output = l($image, imagecache_create_url($args['lightbox_preset'], $item['filepath']), array('attributes' => $link_attributes, 'html' => TRUE));
}
return $output;
}
......@@ -283,7 +301,8 @@ function theme_imagefield_image_imagecache_lightbox2($view_preset, $field_name,
* @return
* The themed link to the file, with lightframe support.
*/
function theme_lightbox2_formatter_filefield_lightframe($element) {
function theme_lightbox2_formatter_filefield_lightframe($variables) {
$element = $variables['element'];
$file = $element['#item'];
$field = content_fields($element['#field_name']);
if (!filefield_view_access($field['field_name']) || empty($file['list'])) {
......@@ -297,7 +316,7 @@ function theme_lightbox2_formatter_filefield_lightframe($element) {
return '';
}
drupal_add_css(drupal_get_path('module', 'filefield') .'/filefield.css');
return '<div class="filefield-item">'. theme('lightbox2_file_formatter_lightbox2_iframe', $file, $field, NULL) .'</div>';
return '<div class="filefield-item">'. theme('lightbox2_file_formatter_lightbox2_iframe', array( 'file' => $file, 'field' => $field, 'file_formatter_settings' => NULL ) ) .'</div>';
}
/**
......@@ -312,10 +331,13 @@ function theme_lightbox2_formatter_filefield_lightframe($element) {
* @return
* Themed link to filefield.
*/
function theme_lightbox2_file_formatter_lightbox2_iframe($file, $field, $file_formatter_settings) {
function theme_lightbox2_file_formatter_lightbox2_iframe($variables) {
$file = $variables['file'];
$field = $varbiables['field'];
$file_formatter_settings = $variables['file_formatter_settings'];
$path = $file->filepath;
$url = file_create_url($path);
$icon = theme('filefield_icon', $file);
$icon = theme('file_icon', array( 'file' => $file ) );
$file_data = $file->data;
if (is_string($file_data)) {
$file_data = unserialize($file->data);
......@@ -350,7 +372,8 @@ function theme_lightbox2_file_formatter_lightbox2_iframe($file, $field, $file_fo
* @return
* The themed link to the embedded image.
*/
function theme_lightbox2_formatter_emimage($element) {
function theme_lightbox2_formatter_emimage($variables) {
$element = $variables['element'];
$field = content_fields($element['#field_name'], $element['#type_name']);
$item = $element['#item'];
$formatter = $element['#formatter'];
......@@ -379,7 +402,12 @@ function theme_lightbox2_formatter_emimage($element) {
* @return
* Themed embedded media field image and link.
*/
function theme_lightbox2_emimage($field, $item, $formatter, $node, $args = array()) {
function theme_lightbox2_emimage($variables) {
$field = $variables['field'];
$item = $variables['item'];
$formatter = $variables['formatter'];
$node = $variables['node'];
$args = $variables['args'];
$lightbox_type = $field['lightbox_type'];
......@@ -440,7 +468,7 @@ function theme_lightbox2_emimage($field, $item, $formatter, $node, $args = array
// Set up url and image.
$url = module_invoke('emfield', 'include_invoke', 'emimage', $item['provider'], 'image_url', $code, $width, $height, "emimage", $field, $item, $node);
$image = theme('image', $url, $title, $title, $attributes, FALSE);
$image = theme('image', array( 'path' => $url, 'alt' => $title, 'title' => $title, 'attributes' => $attributes, 'getsize' => FALSE ) );
// Set up full rel attribute.
$image_grouping = variable_get('lightbox2_emimage_group_node_id', 1);
......@@ -488,7 +516,8 @@ function theme_lightbox2_emimage($field, $item, $formatter, $node, $args = array
* @return
* HTML output for displaying the video and link.
*/
function theme_lightbox2_formatter_emvideo_lightvideo($element) {
function theme_lightbox2_formatter_emvideo_lightvideo($variables) {
$element = $variables['element'];
if (!variable_get('lightbox2_enable_video', FALSE)) {
return;
}
......@@ -516,7 +545,11 @@ function theme_lightbox2_formatter_emvideo_lightvideo($element) {
* @return
* Themed link to the embedded media field video.
*/
function theme_lightbox2_emvideo($field, $item, $formatter, $node, $options = array()) {
function theme_lightbox2_emvideo($variables) {
$field = $variables['field'];
$item = $variables['item'];
$formatter = $variables['formatter'];
$node = $variables['node'];
$thumbnail = isset($options['thumbnail']) ? $options['thumbnail'] : theme('emvideo_video_thumbnail', $field, $item, 'video_thumbnail', $node, TRUE, $options);
// if options title set use that, otherwise use video title if set in node,
// otherwise try node title, then widget thumbnail setting and fallback to
......
; $Id: lightbox2.info,v 1. 2011/01/17 11:51:34 snpower Exp $
name = Lightbox2
description = Enables Lightbox2 for Drupal
core = 6.x
core = 7.x
package = User interface
files[] = lightbox2.install
files[] = lightbox2.module
files[] = lightbox2.formatter.inc
files[] = lightbox2.admin.inc
configure = admin/config/user-interface/lightbox2
; Information added by drupal.org packaging script on 2010-09-24
version = "7.x-dev"
core = "7.x"
project = "lightbox2"
<?php
// $Id: lightbox2.insert.inc,v 1.1.2.6 2010/09/22 10:47:15 snpower Exp $
/**
* @file
......
<?php
// $Id: lightbox2.install,v 1.1.4.4.2.49 2010/09/22 17:26:19 snpower Exp $
/**
* @file
......
This diff is collapsed.
<?php
// $Id: lightbox2.views.inc,v 1.1.2.1 2009/09/05 09:52:26 snpower Exp $
/**
* @file
......
<?php
// $Id: lightbox2_handler_field_lightbox2.inc,v 1.1.2.4 2010/03/07 21:38:39 snpower Exp $
/**
* A handler to provide a field that is completely custom by the administrator.
......
<?php
// $Id: page-node-lightbox2.tpl.php,v 1.1.2.2 2008/06/11 22:16:38 snpower Exp $
/**
* @file
......
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