This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function entity_bundle_ajax_form() { | |
$form['entity_type'] = array( | |
'#type' => 'select', | |
'#title' => t('Entity type'), | |
'#options' => array('' => t('- Select one - ')), | |
'#default_value' => '', | |
'#ajax' => array( | |
'callback' => 'entity_bundle_ajax_form_callback', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
branch-name = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD` | |
cd-root = rev-parse --show-cdup | |
branch-diff = !git format-patch --stdout $1 > `git cd-root``git branch-name`.patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = Hello World | |
description = "The most basic exercise known to programmers, the good old Hello world." | |
core = 7.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = Media browser views | |
description = Provides views integration for the media browser. | |
package = Media | |
core = 7.x | |
dependencies[] = media | |
dependencies[] = views | |
files[] = views_handler_field_file_link_media_browser.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function file_get_uri_from_url($url, $load_file = TRUE) { | |
$base_paths = &drupal_static(__FUNCTION__); | |
if (!isset($base_paths)) { | |
$base_paths = array(); | |
foreach (file_get_stream_wrappers() as $scheme => $stream_wrapper) { | |
$class = file_stream_wrapper_get_class($scheme); | |
if (class_exists($class) && method_exists($class, 'getExternalUrl')) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_theme_registry_alter(). | |
*/ | |
function mymodule_theme_registry_alter(&$info) { | |
// Inject our module into the node theme registry as being an available theme | |
// path so that we can override the node template for our content type. | |
array_splice($info['node']['theme paths'], 1, 0, array(drupal_get_path('module', 'mymodule'))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_media_token_to_markup_alter(). | |
* | |
* Allow non-image files to be embedded in the WYSIWYG by converting the | |
* 'preview' markup to be shown in the WYSIWYG to an image preview of the file. | |
*/ | |
function custom_media_token_to_markup_alter(&$element, $tag_info, $settings) { | |
if (!empty($settings['wysiwyg']) && $tag_info['file']->type != 'image') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_media_browser_plugin_info_alter(). | |
*/ | |
function custom_media_browser_plugin_info_alter(&$info) { | |
unset($info['library']); | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This code was removed from Media module as it was no longer used and does not work. | |
// Removed via http://drupal.org/node/1268268 | |
/** | |
* Filter callback for media url filter. | |
* @TODO: There are currently problems with this. For instance, if a file is | |
* to be loaded from a remote location here, it will be recreated multiple | |
* times, each time this filter is called. If we want to continue supporting |
OlderNewer