Commit fae2628a authored by joseph.olstad's avatar joseph.olstad Committed by joseph.olstad

Issue #3064895 by joseph.olstad: Code standards improvements 2x 3x 4x branches only

parent 1bf81462
......@@ -19,7 +19,7 @@
display: none;
}
/* Workaround for Modal dialog underneith the Ctools modal dialog with jQuery 1.10.
/* Workaround for Modal dialog underneith the Ctools modal dialog with jQuery 1.10.
@TODO Remove this if ever ctools issue #1397370 ever gets fixed. */
.ui-front.media-wrapper {
z-index: 10001 !important;
......@@ -69,7 +69,7 @@
.media-item {
background: #eee;
border: 1px solid #CCCCCC;
border: 1px solid #cccccc;
box-shadow: inset 0 0 15px rgba(0,0,0,.1), inset 0 0 0 1px rgba(0,0,0,.05);
display: inline-block;
padding: 5px;
......@@ -116,17 +116,17 @@
}
.media-list-thumbnails .media-item.selected {
background: #F4ECC7;
border-color: #058AC5;
background: #f4ecc7;
border-color: #058ac5;
}
.media-list-thumbnails .media-item:hover {
border-color: #058AC5;
border-color: #058ac5;
cursor: pointer;
}
.media-list-thumbnails .media-item .label-wrapper label {
color: #058AC5;
color: #058ac5;
}
.media-list-thumbnails .media-item .label-wrapper label:hover {
......@@ -152,5 +152,5 @@
/* Exposed filter field */
/* Use similar look and feel of a disabled field */
.media-ajaxing-disabled {
background-color: #EBEBE4;
background-color: #ebebe4;
}
......@@ -20,8 +20,7 @@ abstract class MediaBrowserPlugin implements MediaBrowserPluginInterface {
protected $info;
/**
* The parameters for the current media browser from
* media_get_browser_params().
* The parameters for current media browser from media_get_browser_params().
*
* @var array
*/
......@@ -83,4 +82,5 @@ abstract class MediaBrowserPlugin implements MediaBrowserPluginInterface {
* Renderable array.
*/
abstract public function view();
}
......@@ -22,8 +22,9 @@ interface MediaBrowserPluginInterface {
* An array of parameters which came in is $_GET['params']. The expected
* parameters are still being defined.
* - 'types': array of media types to support
* - 'multiselect': boolean; TRUE enables multiselect
* - 'multiselect': boolean; TRUE enables multiselect.
*/
public function __construct($info, $params);
/**
......
......@@ -14,6 +14,7 @@ class MediaBrowserUpload extends MediaBrowserPlugin {
/**
* Implements MediaBrowserPluginInterface::access().
*/
public function access($account = NULL) {
return file_entity_access('create', NULL, $account);
}
......@@ -29,4 +30,5 @@ class MediaBrowserUpload extends MediaBrowserPlugin {
return $build;
}
}
......@@ -117,8 +117,8 @@ function media_browser($selected = NULL) {
$settings['media']['browser'][$key] = $plugin_output[$key]['#settings'];
}
// If this is a "ajax" style tab, add the href, otherwise an id. jQuery UI
// will use an href value to load content from that url
// If this is a "ajax" style tab, add the href, otherwise an id. jQuery UI.
// Will use an href value to load content from that url.
$tabid = 'media-tab-' . check_plain($key);
if (!empty($plugin_output[$key]['#callback'])) {
$href = $plugin_output[$key]['#callback'];
......@@ -131,7 +131,7 @@ function media_browser($selected = NULL) {
);
// Create a div for each tab's content.
$plugin_output[$key] += array(
'#prefix' => '<div '. drupal_attributes($attributes) . ">\n",
'#prefix' => '<div ' . drupal_attributes($attributes) . ">\n",
'#suffix' => "</div>\n",
);
}
......
......@@ -2,8 +2,7 @@
/**
* @file
* Provide the media selector widget and media field formatters to the Fields
* API.
* Provide media selector widget and media field formatters to the fields API.
*/
/**
......@@ -137,10 +136,11 @@ function media_field_widget_form(&$form, &$form_state, $field, $instance, $langc
elseif (module_exists('translation') && $element['#entity_type'] == 'node' && translation_supported_type($element['#entity']->type)) {
$element['#media_parent_entity_form_langcode'] = $element['#entity']->language;
$element['#media_parent_entity_source_langcode'] = $element['#entity']->language;
} elseif ($element['#entity_type'] == 'field_collection_item' && !empty($form['#entity']) && property_exists($form['#entity'], 'language')) {
}
elseif ($element['#entity_type'] == 'field_collection_item' && !empty($form['#entity']) && property_exists($form['#entity'], 'language')) {
$element['#media_parent_entity_form_langcode'] = $form['#entity']->language;
}
else if ($element['#entity_type'] == 'paragraphs_item' && !empty($form['#entity'])) {
elseif ($element['#entity_type'] == 'paragraphs_item' && !empty($form['#entity'])) {
$host = $element['#entity']->hostEntity();
if (isset($host->language)) {
$element['#media_parent_entity_form_langcode'] = $host->language;
......@@ -332,7 +332,7 @@ function media_field_widget_process($element, &$form_state, $form) {
* wrapper around the entire group so it can be replaced all at once.
*/
function media_field_widget_process_multiple($element, &$form_state, $form) {
// In order to support multiple selection, we need to reconstruct the _POST
// In order to support multiple selection, we need to reconstruct the _POST
// data that is checked in media_attach_file(). We need to reconstruct the
// field's _POST key name, for example: field_mediafield_und_0.
$upload_name_prefix = implode('_', $element['#parents']) . '_';
......@@ -340,7 +340,7 @@ function media_field_widget_process_multiple($element, &$form_state, $form) {
if (!empty($_POST['media'][$upload_name])) {
$files = explode(',', $_POST['media'][$upload_name]);
$count = count($files);
// Supposing #file_upload_delta is always the last delta this will work
// Supposing #file_upload_delta is always the last delta this will work.
for ($i = 0; $i < $count; $i++) {
// For each file selected, increment the field key to be processed.
// field_mediafield_und_0 becomes field_mediafield_und_1, etc.
......@@ -392,7 +392,7 @@ function media_field_widget_process_multiple($element, &$form_state, $form) {
*
* This helper function is used by media_field_widget_process_multiple().
*
* @param $element
* @param array $element
* The element being processed.
*
* @return
......@@ -412,7 +412,7 @@ function _media_field_get_description_from_element($element) {
}
/**
* Form submission handler for attach/remove button of media_field_widget_form().
* Form submit handler for attach/remove button of media_field_widget_form().
*
* This runs in addition to and after media_field_widget_submit().
*
......@@ -460,7 +460,7 @@ function media_field_widget_submit($form, &$form_state) {
/**
* Returns HTML for an individual media widget.
*
* @param $variables
* @param array $variables
* An associative array containing:
* - element: A render element representing the widget.
*
......@@ -493,7 +493,7 @@ function theme_media_widget($variables) {
/**
* Returns HTML for a group of media widgets.
*
* @param $variables
* @param array $variables
* An associative array containing:
* - element: A render element representing the widgets.
*
......@@ -587,7 +587,11 @@ function theme_media_widget_multiple($variables) {
);
}
$table = array('header' => $headers, 'rows' => $rows, 'attributes' => array('id' => $table_id));
$table = array(
'header' => $headers,
'rows' => $rows,
'attributes' => array('id' => $table_id)
);
drupal_alter('media_widget_multiple', $table, $element);
......@@ -649,6 +653,7 @@ function media_field_formatter_info() {
* Implements hook_field_formatter_settings_form().
*
* Legacy support for the "Large filetype icon" file field formatter.
*
* @see media_field_formatter_info()
*/
function media_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
......@@ -671,6 +676,7 @@ function media_field_formatter_settings_form($field, $instance, $view_mode, $for
* Implements hook_field_formatter_settings_summary().
*
* Legacy support for the "Large filetype icon" file field formatter.
*
* @see media_field_formatter_info()
*/
function media_field_formatter_settings_summary($field, $instance, $view_mode) {
......@@ -698,6 +704,7 @@ function media_field_formatter_settings_summary($field, $instance, $view_mode) {
* Implements hook_field_formatter_view().
*
* Legacy support for the "Large filetype icon" file field formatter.
*
* @see media_field_formatter_info()
*/
function media_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
......
......@@ -2,7 +2,7 @@
/**
* @file
* Media Theming
* Media Theming.
*
* Theming functions for the Media module.
*/
......@@ -14,7 +14,7 @@ function theme_media_thumbnail($variables) {
$label = '';
$element = $variables['element'];
// Wrappers to go around the thumbnail.
// Wrappers to go around the thumbnail.
$attributes = array(
'title' => $element['#name'],
'class' => 'media-item',
......
<?php
/**
* @file
* Contains the media browser tab display plugin.
......
......@@ -15,7 +15,9 @@
*/
class media_views_plugin_style_media_browser extends views_plugin_style_list {
// Stores the files loaded with pre_render.
/**
* Stores the files loaded with pre_render.
*/
public $files = array();
/**
......
<?php
/**
* @file media-views-view-media-browser.tpl.php
* View template to display a grid of media previews in the media browser.
*
*/
/**
* @see views-view-list.tpl.php
* @see template_preprocess_media_views_view_media_browser()
* @ingroup views_templates
......
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