Index: contrib/emimage/providers/photobucket.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emimage/providers/Attic/photobucket.inc,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 photobucket.inc
--- contrib/emimage/providers/photobucket.inc 18 Jul 2008 20:32:59 -0000 1.1.2.2
+++ contrib/emimage/providers/photobucket.inc 25 Jul 2008 06:40:41 -0000
@@ -1,6 +1,11 @@
'fieldset',
'#title' => t('Flickr API'),
'#description' => t('You will first need to apply for an API Developer Key from the !flickr.', array('!flickr' => l(t('Flickr Developer Profile page'), EMIMAGE_FLICKR_API_APPLICATION_URL, array('target' => '_blank')))),
- '#collapsible' => true,
+ '#collapsible' => TRUE,
'#collapsed' => (variable_get('emimage_flickr_api_key', '') != ''),
);
$form['flickr']['api']['emimage_flickr_api_key'] = array(
Index: contrib/emimage/providers/picasa.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emimage/providers/Attic/picasa.inc,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 picasa.inc
--- contrib/emimage/providers/picasa.inc 18 Jul 2008 20:32:59 -0000 1.1.2.2
+++ contrib/emimage/providers/picasa.inc 25 Jul 2008 06:40:41 -0000
@@ -1,6 +1,11 @@
$matches[1],
+ 'server' => $matches[1],
'userid' => $matches[2],
- 's1' => $matches[3],
- 's2' => $matches[4],
- 's3' => $matches[5],
- 'image' => $matches[6],
+ 's1' => $matches[3],
+ 's2' => $matches[4],
+ 's3' => $matches[5],
+ 'image' => $matches[6],
);
}
@@ -123,14 +129,14 @@
}
/**
- * implement emimage_PROVIDER_image_title
+ * Implement emimage_PROVIDER_image_title.
*
- * @param $code
- * the code of the image
- * @param $data
- * any stored data for the image, which may already have the title
- * @return
- * the title as the 3rd party provider knows it, if accessible to us. otherwise, ''
+ * @param $code
+ * The code of the image.
+ * @param $data
+ * Any stored data for the image, which may already have the title.
+ * @return
+ * The title as the 3rd party provider knows it, if accessible to us. otherwise, ''.
*/
function emimage_picasa_image_title($code, $data) {
if (func_num_args() == 7) {
@@ -139,16 +145,18 @@
$data = &$arg['data'];
$title = $code;
}
+
return "$title";
}
function _emimage_picasa_guess_size($width, $height) {
$max = max($width, $height);
- foreach (array('144' => 144, '288' => 288, '400' => 400, '800' => 800) as $size => $value) {
- if ($max <= $value) {
+ foreach (array('144' => 144, '288' => 288, '400' => 400, '800' => 800) as $size => $value) {
+ if ($max <= $value) {
return $size;
- }
+ }
}
+
// we would use the original size if we could, but we can't since google won't serve it
return '800';
}
Index: contrib/emimage/emimage.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emimage/Attic/emimage.install,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 emimage.install
--- contrib/emimage/emimage.install 18 Jul 2008 20:32:59 -0000 1.1.2.2
+++ contrib/emimage/emimage.install 25 Jul 2008 06:40:41 -0000
@@ -2,6 +2,11 @@
// $Id: emimage.install,v 1.1.2.2 2008/07/18 20:32:59 alexua Exp $
/**
+ * @file
+ * This is the emimage.module's install, configuration, and removal instructions.
+ */
+
+/**
* Implementation of hook_install().
*/
function emimage_install() {
@@ -16,29 +21,31 @@
}
/**
-* Implementation of hook_enable().
-*/
+ * Implementation of hook_enable().
+ */
function emimage_enable() {
content_notify('enable', 'emimage');
}
/**
-* Implementation of hook_disable().
-*/
+ * Implementation of hook_disable().
+ */
function emimage_disable() {
content_notify('disable', 'emimage');
}
function emimage_update_1() {
$ret = _emimage_update_reset_cache_views();
+
return $ret;
}
-// I'd like this to be conditional, so it only runs if they don't have views installed.
-// however, module_exists doesn't actually work in the update scripts.
-// TODO: conditional on if table exists instead...
+// I'd like this to be conditional, so it only runs if they don't have Views installed.
+// However, module_exists doesn't actually work in the update scripts.
+// TODO: Conditional on if table exists instead...
function _emimage_update_reset_cache_views() {
$ret = array();
$ret[] = update_sql("DELETE FROM {cache_views}");
+
return $ret;
}
Index: contrib/emvideo/emvideo.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/Attic/emvideo.info,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 emvideo.info
--- contrib/emvideo/emvideo.info 18 Jul 2008 20:22:44 -0000 1.1.2.1
+++ contrib/emvideo/emvideo.info 25 Jul 2008 06:40:41 -0000
@@ -1,6 +1,8 @@
; $Id: emvideo.info,v 1.1.2.1 2008/07/18 20:22:44 alexua Exp $
+
name = Embedded Video Field
description = Defines a field type for displaying third party videos, such as YouTube and Google Video.
+
+core = 6.x
dependencies[] = emfield
package = CCK
-core = 6.x
Index: contrib/emvideo/emvideo.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/Attic/emvideo.install,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 emvideo.install
--- contrib/emvideo/emvideo.install 18 Jul 2008 20:22:44 -0000 1.1.2.1
+++ contrib/emvideo/emvideo.install 25 Jul 2008 06:40:41 -0000
@@ -2,6 +2,11 @@
// $Id: emvideo.install,v 1.1.2.1 2008/07/18 20:22:44 alexua Exp $
/**
+ * @file
+ * Installation, configuration, and removal of the emvideo module.
+ */
+
+/**
* Implementation of hook_install().
*/
function emvideo_install() {
@@ -16,28 +21,28 @@
}
/**
-* Implementation of hook_enable().
-*/
+ * Implementation of hook_enable().
+ */
function emvideo_enable() {
content_notify('enable', 'emvideo');
}
/**
-* Implementation of hook_disable().
-*/
+ * Implementation of hook_disable().
+ */
function emvideo_disable() {
content_notify('disable', 'emvideo');
}
/**
- * we need to make sure to show our new 'embed code' filter on views
+ * We need to make sure to show our new 'embed code' filter on Views.
*/
function emvideo_update_1() {
return _emvideo_update_reset_cache();
}
/**
- * we need a new data field for extra info stored by certain providers, such as blip.tv
+ * We need a new data field for extra info stored by certain providers, such as blip.tv.
*/
function emvideo_update_2() {
$ret = array();
@@ -52,7 +57,7 @@
switch ($field['type']) {
case 'emvideo':
$columns = array(
- 'data' => array('type' => 'longtext', 'not null' => TRUE, 'default' => "''", 'sortable' => false),
+ 'data' => array('type' => 'longtext', 'not null' => TRUE, 'default' => "''", 'sortable' => FALSE),
);
// the following line will trigger (negligible) warnings if emvideo_update_2 was run before
// (column already exists)
@@ -62,25 +67,28 @@
}
$ret = _emvideo_update_reset_cache();
$ret[] = update_sql("DELETE FROM {cache}");
+
return $ret;
}
function _emvideo_update_reset_cache() {
$ret = _emvideo_update_reset_cache_views();
$ret[] = update_sql("DELETE FROM {cache_content}");
+
return $ret;
}
/**
- * since we made our engine dependent on emfield, we need to change some variables accordingly
+ * Since we made our engine dependent on emfield, we need to change some variables accordingly.
*/
function emvideo_update_3() {
$ret = array();
foreach (emfield_system_list('emvideo') as $provider) {
// TODO: this will need some attention when we upgrade to d6
$test = variable_get('emvideo_allow_'. $provider->name, NULL);
+
if (isset($test)) {
- variable_set('emfield_'. $module .'_allow_'. $provider->name, variable_get('emvideo_allow_'. $provider->name, true));
+ variable_set('emfield_'. $module .'_allow_'. $provider->name, variable_get('emvideo_allow_'. $provider->name, TRUE));
}
}
$ret[] = array(
@@ -91,12 +99,13 @@
// now we need to depend on emfield's menu. remove our old admin menu path
menu_rebuild();
+
return $ret;
}
/**
- * oops. cleanup from update 3 -- we don't want to accidentally reset our variables
- * if we have to run update 3 again...
+ * Oops. Cleanup from update 3 -- we don't want to accidentally reset our
+ * variables if we have to run update 3 again.
*/
function emvideo_update_4() {
$ret = array();
@@ -111,28 +120,35 @@
'query' => t('The old Embedded Video Field allowed provider variables have been cleaned up.'),
'success' => TRUE
);
+
return $ret;
}
/**
- * changed the data structure for blip.tv
- * TODO: this doesn't work. thought data was cached? ...
+ * Changed the data structure for blip.tv
+ *
+ * TODO: This doesn't work. Thought data was cached?
*/
function emvideo_update_5() {
$ret = _emvideo_update_reset_cache();
$ret[] = update_sql("DELETE FROM {cache}");
+
return $ret;
}
function emvideo_update_6() {
$ret = _emvideo_update_reset_cache_views();
+
return $ret;
}
-// I'd like this to be conditional, so it only runs if they don't have views installed.
-// however, module_exists doesn't actually work in the update scripts.
+/**
+ * I'd like this to be conditional, so it only runs if they don't have Views
+ * installed. However, module_exists doesn't actually work in the update scripts.
+ */
function _emvideo_update_reset_cache_views() {
$ret = array();
$ret[] = update_sql("DELETE FROM {cache_views}");
+
return $ret;
}
Index: contrib/emvideo/emvideo.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/Attic/emvideo.theme.inc,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 emvideo.theme.inc
--- contrib/emvideo/emvideo.theme.inc 18 Jul 2008 20:29:04 -0000 1.1.2.2
+++ contrib/emvideo/emvideo.theme.inc 25 Jul 2008 06:40:41 -0000
@@ -7,9 +7,9 @@
*/
/**
- * formatter for emvideo_video_embed
- *
- * this will return the 'embed code', typically used to embed media in an external site or blog.
+ * Formatter for emvideo_video_embed.
+ * This will return the 'embed code', typically used to embed media in an
+ * external site or blog.
*/
function theme_emvideo_video_embed($field, $item, $formatter, $node, $options = array()) {
/*
@@ -25,52 +25,55 @@
if ($item['value'] && $item['provider']) {
$output = drupal_get_form('emvideo_embed_form', $field, $item, $formatter, $node, $options);
}
+
return $output;
}
/**
- * This will return a provided thumbnail image for a video.
+ * This will return a provided thumbnail image for a video.
*
- * @param $field
- * This is the field providing settings for the video thumbnail.
- * @param $item
- * This is the data returned by the field. It requires at the least to be an array with 'value' and 'provider'.
- * $item['value'] will be the video code, and $item['provider'] will be the provider, such as youtube.
- * @param $formatter
- * This is the formatter for the view. This will nearly always be video_thumbnail.
- * @param $node
- * This is the node object containing the field.
- * @param $no_link
- * optional. if FALSE, then we provide a link to the node. (In retrospect, this should have been $link, defaulting to TRUE. TODO: fix? problem though is that this goes deeper up the tree.)
- * @param $options
- * optional array. this is to pass optional overrides. currently:
- * $options['width'] and $options['height'], if provided, will override any field settings for the thumbnail w/h.
- * $options['link_url'], if provided, will cause the thumbnail link to go to another URL other than node/nid. $no_link must be FALSE.
- * $options['link_title'], if provided, will set the title of the link when no image is provided. otherwise, it defaults to 'See video'.
- * $options['image_title'], if provided, will set the title attribute of the href link, defaulting to $options['link_title'].
- * $options['image_alt'], if provided, will set the alt attribute of the href link, defaulting to $options['link_title'].
- * $options['thumbnail_url'], if provided, will completely override the thumbnail image entirely.
+ * @param $field
+ * This is the field providing settings for the video thumbnail.
+ * @param $item
+ * This is the data returned by the field. It requires at the least to be an array with 'value' and 'provider'.
+ * $item['value'] will be the video code, and $item['provider'] will be the provider, such as youtube.
+ * @param $formatter
+ * This is the formatter for the view. This will nearly always be video_thumbnail.
+ * @param $node
+ * This is the node object containing the field.
+ * @param $no_link
+ * Optional. If FALSE, then we provide a link to the node.
+ * (In retrospect, this should have been $link, defaulting to TRUE.
+ * TODO: fix? problem though is that this goes deeper up the tree.)
+ * @param $options
+ * Optional array. This is to pass optional overrides. currently:
+ * $options['width'] and $options['height'], if provided, will override any field settings for the thumbnail w/h.
+ * $options['link_url'], if provided, will cause the thumbnail link to go to another URL other than node/nid. $no_link must be FALSE.
+ * $options['link_title'], if provided, will set the title of the link when no image is provided. otherwise, it defaults to 'See video'.
+ * $options['image_title'], if provided, will set the title attribute of the href link, defaulting to $options['link_title'].
+ * $options['image_alt'], if provided, will set the alt attribute of the href link, defaulting to $options['link_title'].
+ * $options['thumbnail_url'], if provided, will completely override the thumbnail image entirely.
*/
function theme_emvideo_video_thumbnail($field, $item, $formatter, $node, $no_link = FALSE, $options = array()) {
if ($item['value'] && $item['provider']) {
- // if we've set $options['thumbnail_url'], then we'll just use that.
- // otherwise, if we have emthumb installed, then give it a chance to override our thumbnail
+ // If we've set $options['thumbnail_url'], then we'll just use that.
+ // Otherwise, if we have emthumb installed, then give it a chance to override our thumbnail
$thumbnail_url = $options['thumbnail_url'] ? $options['thumbnail_url'] : module_invoke('emthumb', 'thumbnail_url', $item);
// if we don't have a custom thumbnail, then see if the provider gives us a thumbnail
$thumbnail_url = $thumbnail_url ? $thumbnail_url : module_invoke('emfield', 'include_invoke', 'emvideo', $item['provider'], 'thumbnail', $field, $item, $formatter, $node, $width, $height, $options);
- // if we still don't have a thumbnail, then apply a default thumbnail, if it exists
+ // If we still don't have a thumbnail, then apply a default thumbnail, if it exists.
if (!$thumbnail_url) {
$default_thumbnail_url = $field['widget']['thumbnail_default_path'] ? $field['widget']['thumbnail_default_path'] : variable_get('emvideo_default_thumbnail_path', NULL);
+
if ($default_thumbnail_url) {
$thumbnail_url = base_path() . $default_thumbnail_url;
}
}
}
else {
- // seems to be an unknown video
- // apply a default thumbnail, if it exists
+ // Seems to be an unknown video. Apply a default thumbnail, if it exists.
if (!$thumbnail_url) {
$default_thumbnail_url = $field['widget']['thumbnail_default_path'] ? $field['widget']['thumbnail_default_path'] : variable_get('emvideo_default_thumbnail_path', NULL);
if ($default_thumbnail_url) {
@@ -93,7 +96,7 @@
$output = '';
}
else {
- $output = l('', $link_url, array(), NULL, NULL, false, true);
+ $output = l('', $link_url, array(), NULL, NULL, FALSE, TRUE);
}
}
else {
@@ -118,6 +121,7 @@
$output = module_invoke('emfield', 'include_invoke', 'emvideo', $item['provider'], 'video', $embed, $width, $height, $field, $item, $autoplay, $options);
}
$output .= 'test2';
+
return $output;
}
@@ -133,23 +137,26 @@
$autoplay = $options['autoplay'] ? $options['autoplay'] : $field['widget']['preview_autoplay'];
$output = module_invoke('emfield', 'include_invoke', 'emvideo', $item['provider'], 'preview', $embed, $width, $height, $field, $item, $autoplay, $options);
}
+
return $output;
}
function theme_emvideo_thickbox($field, $item, $formatter, $node, $options = array()) {
- $thumbnail = theme('emvideo_video_thumbnail', $field, $item, 'video_thumbnail', $node, true, $options);
+ $thumbnail = theme('emvideo_video_thumbnail', $field, $item, 'video_thumbnail', $node, TRUE, $options);
$destination = 'video-cck/thickbox/'. $node->nid .'/'. $field['widget']['video_width'] .'/'. $field['widget']['video_height'] .'/'. $field['field_name'];
$options = array(
- 'attributes'=> array(
+ 'attributes' => array(
'title' => $title,
'class' => 'thickbox',
- 'rel' => $field['type_name']),
+ 'rel' => $field['type_name'],
+ ),
'query' => NULL,
'fragment' => NULL,
'absolute' => FALSE,
'html' => TRUE,
- );
- $output = l($thumbnail, $destination, $options);
- return $output;
+ );
+ $output = l($thumbnail, $destination, $options);
+
+ return $output;
}
Index: contrib/emvideo/emvideo.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/Attic/emvideo.module,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 emvideo.module
--- contrib/emvideo/emvideo.module 23 Jul 2008 01:12:06 -0000 1.1.2.2
+++ contrib/emvideo/emvideo.module 25 Jul 2008 06:40:41 -0000
@@ -1,6 +1,11 @@
MENU_CALLBACK,
);
}
+
return $items;
}
/**
- * Implement hook_emfield_info
+ * Implementation of hook_emfield_info().
*/
function emvideo_emfield_info() {
$name = t('Embedded Video Field');
@@ -67,18 +73,19 @@
}
/**
- * Implement hook_emfield_settings
+ * Implementation of hook_emfield_settings().
*
- * This would be to add any extra settings (besides providers) to the emfield settings configuration page.
- * Video CCK doesn't require anything at the moment.
+ * This would be to add any extra settings (besides providers) to the emfield
+ * settings configuration page. Video CCK doesn't require anything at the moment.
*/
function emvideo_emfield_settings() {
$form = array();
+
return $form;
}
/**
- * Implementation of hook_field_info
+ * Implementation of hook_field_info().
*/
function emvideo_field_info() {
$fields = array(
@@ -91,6 +98,7 @@
),
),
);
+
return $fields;
}
@@ -99,9 +107,9 @@
*/
function emvideo_field_settings($op, $field) {
switch ($op) {
-
case 'database columns':
return module_invoke('emfield', 'field_columns', $field);
+
case 'filters':
return array(
'not null' => array(
@@ -123,6 +131,7 @@
),
);
break;
+
case 'arguments':
return array(
'content: '. $field['field_name'] => array(
@@ -141,20 +150,24 @@
}
/**
- * implement hook_content_is_empty
+ * Implementation of hook_content_is_empty().
*/
function emvideo_content_is_empty($item, $field) {
return module_invoke('emfield', 'emfield_content_is_empty', $item, $field);
}
-//** Implementation of hook_field **/
+/**
+ * Implementation of hook_field().
+ */
function emvideo_field($op, &$node, $field, &$items, $teaser, $page) {
if (module_hook('emfield', 'emfield_field')) {
return emfield_emfield_field($op, $node, $field, $items, $teaser, $page, 'emvideo');
}
}
-/** Implementation of hook_field_formatter_info **/
+/**
+ * Implementation of hook_field_formatter_info()
+ */
function emvideo_field_formatter_info() {
$types = array('emvideo', );
$formats = array(
@@ -179,24 +192,30 @@
'field types' => $types,
),
);
- // add thickbox formatter if thickbox module exists
+
+ // Add thickbox formatter if thickbox module exists.
if (module_exists('thickbox')) {
$formats['thickbox'] = array(
'label' => t('Thickbox: Image Thumbnail -> Full Size Video'),
'field types' => $types,
);
}
+
return $formats;
}
-/** Implementation of hook_field_formatter **/
+/**
+ * Implementation of hook_field_formatter().
+ */
function emvideo_field_formatter($field, $item, $formatter, $node) {
return module_invoke('emfield', 'emfield_field_formatter', $field, $item, $formatter, $node, 'emvideo');
}
/** Widgets **/
-/** Implementation of hook_widget_info **/
+/**
+ * Implementation of hook_widget_info
+ */
function emvideo_widget_info() {
return array(
'emvideo_textfields' => array(
@@ -344,8 +363,9 @@
}
}
-/** Implementation of hook_widget **/
-
+/**
+ * Implementation of hook_widget()
+ */
function emvideo_widget(&$form, &$form_state, $field, $items, $delta = 0) {
if (module_hook('emfield', 'emfield_widget')) {
return emfield_emfield_widget($form, $form_state, $field, $items, $delta, 'emvideo');
@@ -367,13 +387,15 @@
'#description' => $description,
'#default_value' => $text,
);
+
return $form;
}
/**
- * providers may supply an enclosure for rss feeds. this expects something in a file format, so would be an object
- * in the format of $file->filepath, $file->filesize, and $file->filemime.
- * calls the providers hook EMVIDEO_PROVIDER_RSS($item, $teaser)
+ * Providers may supply an enclosure for rss feeds. This expects something in a
+ * file format, so would be an object in the format of $file->filepath,
+ * $file->filesize, and $file->filemime.
+ * Calls the providers hook EMVIDEO_PROVIDER_RSS($item, $teaser).
*/
function emvideo_emfield_rss($node, $items = array(), $teaser = NULL) {
$rss_data = array();
@@ -383,6 +405,7 @@
$rss_data[] = module_invoke('emfield', 'include_invoke', 'emvideo', $item['provider'], 'rss', $item, $teaser);
}
}
+
return $rss_data;
}
@@ -391,18 +414,18 @@
}
/**
- * Page callback for video-cck/thickbox.
- * This will display our video in a modal window defined by the thickbox module.
- * As it's a direct callback, it displays no HTML other than the video.
+ * Page callback for video-cck/thickbox.
+ * This will display our video in a modal window defined by the thickbox module.
+ * As it's a direct callback, it displays no HTML other than the video.
*/
function emvideo_thickbox($nid, $width, $height, $field_name) {
- $field = array();
- $field['widget']['video_width'] = $width;
- $field['widget']['video_height'] = $height;
- $field['widget']['video_autoplay'] = 1;
- $field['field_name'] = $field_name;
- $node = node_load($nid);
- $items = $node->$field_name;
- $item = $items[0];
- print theme('emvideo_video_video', $field, $item, 'video_video', $node);
+ $field = array();
+ $field['widget']['video_width'] = $width;
+ $field['widget']['video_height'] = $height;
+ $field['widget']['video_autoplay'] = 1;
+ $field['field_name'] = $field_name;
+ $node = node_load($nid);
+ $items = $node->$field_name;
+ $item = $items[0];
+ print theme('emvideo_video_video', $field, $item, 'video_video', $node);
}
Index: contrib/emvideo/providers/myspace.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/myspace.inc,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 myspace.inc
--- contrib/emvideo/providers/myspace.inc 18 Jul 2008 20:29:04 -0000 1.1.2.2
+++ contrib/emvideo/providers/myspace.inc 25 Jul 2008 06:40:41 -0000
@@ -1,6 +1,11 @@
data;
}
+
return $thumbnail;
}
Index: contrib/emvideo/providers/youtube.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/youtube.inc,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 youtube.inc
--- contrib/emvideo/providers/youtube.inc 18 Jul 2008 20:29:04 -0000 1.1.2.2
+++ contrib/emvideo/providers/youtube.inc 25 Jul 2008 06:40:41 -0000
@@ -1,6 +1,11 @@
'fieldset',
'#title' => t('YouTube API'),
'#description' => t('The API is no longer required. However, there may be future features requiring it (such as the ability to display otherwise private videos). You will first need to apply for an API Developer Key from the !youtube. Note that you do not need this key to display YouTube videos or their thumbnails.', array('!youtube' => l('YouTube Developer Profile page', EMVIDEO_YOUTUBE_API_APPLICATION_URL, array('target' => '_blank')))),
- '#collapsible' => true,
- '#collapsed' => true,
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
);
$form['youtube']['api']['emvideo_youtube_api_key'] = array(
'#type' => 'textfield',
@@ -73,8 +78,8 @@
'#type' => 'fieldset',
'#title' => t('Embedded Video Player Colors'),
'#description' => t('If allowed, these two colors, in hexidecimal form (#RRGGBB), will be used to skin the YouTube player.'),
- '#collapsible' => true,
- '#collapsed' => true,
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
);
$form['youtube']['colors']['emvideo_youtube_show_colors'] = array(
'#type' => 'checkbox',
@@ -111,7 +116,7 @@
'#title' => t('Color 2 picker'),
'#description' => t('Click in this textfield to start picking your color'),
);
- }
+ }
else {
$form['youtube']['colors']['#description'] .= t(' The !colorpicker, if active, gives an easy way to select these colors.', array('!colorpicker' => l(t('Colorpicker module'), 'http://drupal.org/project/colorpicker')));
}
@@ -158,7 +163,7 @@
else {
$data = emvideo_youtube_data(NULL, $item);
}
-
+
$file = array();
if (is_array($data['flash'])) {
$file['filepath'] = $data['flash']['url'];
@@ -223,8 +228,9 @@
function emvideo_youtube_convert_color($color = NULL) {
if ($color{0} == '#') {
- return substr($color, 1);
+ return drupal_substr($color, 1);
}
+
return $color;
}
@@ -240,7 +246,7 @@
if (variable_get('emvideo_youtube_show_colors', FALSE)) {
$color1 = emvideo_youtube_convert_color(variable_get('emvideo_youtube_colors_color1', EMVIDEO_YOUTUBE_COLOR1_DEFAULT));
$color2 = emvideo_youtube_convert_color(variable_get('emvideo_youtube_colors_color2', EMVIDEO_YOUTUBE_COLOR2_DEFAULT));
- $colors='&color1=0x'.$color1.'&color2=0x'.$color2;
+ $colors='&color1=0x'. $color1 .'&color2=0x'. $color2;
}
$border = (variable_get('emvideo_youtube_show_border', FALSE) == FALSE ? '' : '&border=1');
$output .= "