Skip to content

Instantly share code, notes, and snippets.

@and1truong
Created March 23, 2012 07:10
Show Gist options
  • Select an option

  • Save and1truong/2167875 to your computer and use it in GitHub Desktop.

Select an option

Save and1truong/2167875 to your computer and use it in GitHub Desktop.
Multi Insert
name = Multiupload Insert
version = 7.x-1.0
description = "Support insert feature for multiupload widget."
core = 7.x
dependencies[] = image
dependencies[] = insert
<?php
/**
* @file
* mult_insert.module
*/
/**
* Implements hook_insert_widgets().
*/
function multi_insert_insert_widgets() {
$items['image_miw'] = array(
'element_type' => 'mfw_managed_file',
'wrapper' => '.image-widget',
'fields' => array(
'alt' => 'input[name$="[alt]"], textarea[name$="[alt]"]',
'title' => 'input[name$="[title]"], textarea[name$="[title]"]',
'description' => 'input[name$="[description]"], textarea[name$="[description]"]',
),
);
return $items;
}
/**
* Implementation of hook_insert_styles().
*/
function multi_insert_insert_styles() {
return image_insert_styles();
}
/**
* Implementation of hook_insert_content().
*/
function multi_insert_insert_content($item, $style, $widget) {
return image_insert_content($item, $style, $widget);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment