Commit 17e564ad authored by bneil's avatar bneil Committed by Devin Carlson

Issue #2610352 by bneil: Comment updates/coding standards

parent 185cf4b8
......@@ -12,7 +12,7 @@ module_load_include('php', 'quickedit', 'includes/QuickEditInPlaceEditorInterfac
/**
* Defines the CKEditor in-place editor.
*/
class CKEditor implements QuickEditInPlaceEditorInterface{
class CKEditor implements QuickEditInPlaceEditorInterface {
/**
* Implements QuickEditInPlaceEditorInterface::isCompatible().
......@@ -77,7 +77,7 @@ class CKEditor implements QuickEditInPlaceEditorInterface{
'data' => array(
'quickedit' => array(
'ckeditor' => array(
'basePath' => base_path() . drupal_get_path('module', 'editor_ckeditor') . '/lib/ckeditor/',
'basePath' => base_path() . drupal_get_path('module', 'editor_ckeditor') . '/lib/ckeditor/',
),
),
),
......
......@@ -17,7 +17,7 @@
* activated in a 'text_format' element, the text editor associated with the
* format should be activated on the text area.
*
* @return
* @return array
* An associative array of editors, whose keys are internal editor names,
* which should be unique and therefore prefixed with the name of the module.
* Each value is an associative array describing the editor, with the
......@@ -53,7 +53,7 @@ function hook_editor_info() {
/**
* Perform alterations on editor definitions.
*
* @param $editors
* @param array $editors
* Array of information on editors exposed by hook_editor_info()
* implementations.
*/
......
......@@ -47,8 +47,8 @@ function editor_css_alter(&$css) {
}
}
/**
* Implements hook_module_implements_alter().
/**
* Implements hook_module_implements_alter().
*/
function editor_module_implements_alter(&$implementations, $hook) {
if ($hook == 'element_info_alter') {
......@@ -259,14 +259,14 @@ function editor_element_info_alter(&$type) {
* $form_state['values']['body']['format'] = 'foo';
* @endcode
*
* @param $element
* @param array $element
* The form element to process. Properties used:
* - #base_type: The form element #type to use for the 'value' element.
* 'textarea' by default.
* - #format: (optional) The text format ID to preselect. If NULL or not set,
* the default format for the current user will be used.
*
* @return
* @return array
* The expanded element.
*
* @see filter_process_format()
......@@ -440,6 +440,7 @@ function editor_process_format($element) {
* @param array $formats
* An array of formats as returned by filter_formats(), whose settings should
* be added to the page.
*
* @return array
* An array of attached libraries, CSS, and JS that can be set to an element's
* #attached property.
......@@ -478,7 +479,7 @@ function editor_get_attached($formats) {
/**
* Get a complete list of allowed and forbidden tags for a text format.
*
* @param $format
* @param object $format
* The text format object for which the list will be generated.
*
* @return array|TRUE
......@@ -578,8 +579,8 @@ function editor_format_allowed_html($format) {
}
// Both list an array of attribute values; do an intersection,
// where we take into account that a value of:
// - TRUE means the attribute value is allowed;
// - FALSE means the attribute value is forbidden;
// - TRUE means the attribute value is allowed;
// - FALSE means the attribute value is forbidden;
// hence we keep the ANDed result.
else {
$intersection = array_intersect_key($current_attributes, $new_attributes);
......@@ -629,10 +630,10 @@ function editor_format_allowed_html($format) {
/**
* Checks a user's access to a particular text format.
*
* @param $format
* @param object $format
* A text format object.
*
* @return
* @return bool
* TRUE if the text format can be used by the current user, FALSE otherwise.
*/
function editor_format_access($format) {
......@@ -644,7 +645,7 @@ function editor_format_access($format) {
/**
* Loads an individual editor's information.
*
* @param $editor_name
* @param string|FALSE $editor_name
* The internal editor name of the editor to load.
*/
function editor_load($editor_name) {
......@@ -656,7 +657,7 @@ function editor_load($editor_name) {
/**
* Returns a list of text editors that are used with 'text_format' elements.
*
* @return
* @return array
* An associative array of editors keyed by the internal name of the editor.
* Each editor may contain the following elements (all are optional except as
* noted):
......@@ -755,7 +756,7 @@ function editor_get_js_settings($formats) {
* filter_format_load() because filter.module does not provide a way to load
* additional data when a format is retrieved from the database.
*
* @param $format
* @param object $format
* An object representing the text format.
*
* @todo Remove this when we can alter filter_format_load() or filter_formats().
......
......@@ -11,7 +11,7 @@
* @param string $values
* The values that should be passed to the form constructor in Drupal.
*
* @return
* @return array
* An array suitable for use with the ajax_render() function.
*/
function editor_command_editor_dialog_save($values) {
......
......@@ -29,7 +29,7 @@ function editor_field_attach_delete_revision($entity_type, $entity) {
foreach ($files as $fid => $count) {
if ($file = file_load($fid)) {
file_usage_delete($file, 'editor', $entity_type , $id, $count);
file_usage_delete($file, 'editor', $entity_type, $id, $count);
}
}
}
......@@ -62,8 +62,8 @@ function _editor_filter_add_file_usage_from_fields($entity_type, $entity) {
// so that a correct file count can be created for that (the current) version
// ID. This code may assume some things about entities that are only true for
// node objects and should be reviewed.
// @TODO this conditional can probably be condensed
if (empty($entity->revision) && empty($entity->old_vid) && empty($entity->is_new) && ! empty($entity->original)) {
// @TODO this conditional can probably be condensed.
if (empty($entity->revision) && empty($entity->old_vid) && empty($entity->is_new) && !empty($entity->original)) {
$old_files = editor_entity_field_count_files($entity_type, $entity->original);
foreach ($old_files as $fid => $old_file_count) {
......@@ -75,7 +75,7 @@ function _editor_filter_add_file_usage_from_fields($entity_type, $entity) {
if ($old_file_count > $entity_files[$fid]) {
$deprecate = $old_file_count - $entity_files[$fid];
// Now deprecate this usage
// Now deprecate this usage.
$file = file_load($fid);
if ($file) {
......@@ -86,7 +86,7 @@ function _editor_filter_add_file_usage_from_fields($entity_type, $entity) {
unset($entity_files[$fid]);
}
// There are the same number of files, nothing to do.
elseif ($entity_files[$fid] == $old_file_count) {
elseif ($entity_files[$fid] == $old_file_count) {
unset($entity_files[$fid]);
}
// There are more files now, adjust the difference for the greater number.
......@@ -113,12 +113,12 @@ function _editor_filter_add_file_usage_from_fields($entity_type, $entity) {
/**
* Retrieve a count of all of the files referenced by an entity.
*
* @param $entity
* The entity whose files are being counted.
* @param $entity_type
* @param string $entity_type
* The type of the entity whose files are being counted.
* @param object $entity
* The entity whose files are being counted.
*
* @return
* @return array
* An array of file counts keyed by file ID.
*/
function editor_entity_field_count_files($entity_type, $entity) {
......@@ -141,12 +141,12 @@ function editor_entity_field_count_files($entity_type, $entity) {
/**
* Parse file references from an entity's text fields.
*
* @param $entity
* The entity whose fields are being parsed.
* @param $entity_type
* @param string $entity_type
* The type of the entity whose fields are being parsed.
* @param object $entity
* The entity whose fields are being parsed.
*
* @return
* @return array
* An array of file IDs corresponding to the files referenced in the fields.
*/
function editor_filter_parse_from_fields($entity_type, $entity) {
......@@ -189,12 +189,12 @@ function editor_filter_parse_from_fields($entity_type, $entity) {
/**
* Retrieve a list of fields attached to an entity with text processing support.
*
* @param $entity
* The entity whose fields are being examined.
* @param $entity_type
* @param string $entity_type
* The type of the entity whose fields are being examined.
* @param object $entity
* The entity whose fields are being examined.
*
* @return
* @return array
* An array of the field names which support text processing.
*/
function editor_filter_fields_with_text_filtering($entity_type, $entity) {
......
......@@ -29,7 +29,7 @@ function filter_library() {
$libraries['filter.filtered_html.admin'] = array(
'version' => VERSION,
'js' => array(
$path . '/js/filter/filter.filtered_html.admin.js' => array('group' => JS_THEME, 'aggregate' => FALSE,),
$path . '/js/filter/filter.filtered_html.admin.js' => array('group' => JS_THEME, 'aggregate' => FALSE),
),
'dependencies' => array(
array('filter', 'filter.admin'),
......@@ -40,7 +40,7 @@ function filter_library() {
$libraries['filter.admin'] = array(
'version' => VERSION,
'js' => array(
$path . '/js/filter/filter.admin.js' => array('group' => JS_THEME, 'aggregate' => FALSE,),
$path . '/js/filter/filter.admin.js' => array('group' => JS_THEME, 'aggregate' => FALSE),
),
'css' => array(
$path . '/css/filter/filter.css' => array(),
......
......@@ -22,7 +22,7 @@ function editor_filter_format_update($format) {
/**
* Helper function to save editor information on text format insert/update.
*
* @param $format
* @param object $format
* An object representing the text format.
*/
function _editor_format_save($format) {
......
......@@ -44,11 +44,11 @@ function editor_admin_overview($variables) {
/**
* Returns HTML for a textarea form element.
*
* @param $variables
* @param array $variables
* An associative array containing:
* - element: An associative array containing the properties of the element.
* Properties used: #title, #value, #description, #rows, #cols, #required,
* #attributes, #resizable
* #attributes, #resizable.
*
* @ingroup themeable
*/
......
......@@ -51,6 +51,7 @@
* group indicators.
* - required_html: If this button requires certain HTML tags to be allowed,
* specify an array of tags.
*
* @return array
* An array of plugin definitions, keyed by the plugin name.
*
......@@ -74,7 +75,7 @@ function hook_editor_ckeditor_plugins() {
* This hook may be used to modify plugin properties after they have been
* specified by other modules.
*
* @param $plugins
* @param array $plugins
* An array of all the existing plugin definitions, passed by reference.
*
* @see hook_editor_ckeditor_plugins()
......@@ -100,10 +101,10 @@ function hook_editor_ckeditor_plugins_alter(array &$plugins) {
* ckeditor_stylesheets[] = css/ckeditor-iframe.css
* @endcode
*
* @param $css
* @param array $css
* An array of CSS files, passed by reference. This is a flat list of file
* paths relative to the Drupal root.
* @param $format
* @param object $format
* The corresponding text format object as returned by filter_format_load()
* for which the current text editor is being displayed.
*
......@@ -133,7 +134,7 @@ function hook_editor_ckeditor_css_alter(array &$css, $format) {
* @param string $plugin_name
* String name of the plugin that is being checked.
*
* @return boolean
* @return bool
* Boolean TRUE if the plugin should be enabled, FALSE otherwise.
*
* @see hook_editor_ckeditor_plugins()
......
......@@ -186,7 +186,7 @@ function editor_ckeditor_editor_ckeditor_plugins() {
'tags' => array('figure', 'figcaption'),
'attributes' => array('src', 'alt', 'class', 'data-placeholder'),
),
)
),
);
// The drupallink plugin replaces normal link functionality.
......@@ -246,7 +246,7 @@ function editor_ckeditor_editor_ckeditor_css_alter(array &$css, $format) {
* the text editor's configuration so that EditorImageDialog knows whether it
* should allow the user to upload images.
*
* @param $format
* @param object $format
* The text format that is being edited.
*
* @return array
......
......@@ -220,7 +220,7 @@ function editor_ckeditor_form_filter_format_editor_image_form_alter(&$form, $for
* Checks if the Caption plugin should be enabled based on the configuration of
* a text format and editor.
*
* @param $format
* @param object $format
* The filter format object for which to check the settings of.
*
* @return bool
......@@ -242,7 +242,7 @@ function editor_ckeditor_image_plugin_check($format) {
/**
* Editor JS settings callback; Add CKEditor settings to the page for a format.
*
* @param $format
* @param object $format
* The filter format object for which CKEditor is adding its settings.
* @param $existing_settings
* Settings that have already been added to the page by filters.
......@@ -428,7 +428,7 @@ function editor_ckeditor_get_settings($format, $existing_settings) {
* filter system, by enabling CKEditor's Advanced Content Filter (ACF)
* functionality: http://ckeditor.com/blog/CKEditor-4.1-RC-Released.
*
* @param $format
* @param object $format
* The text format object.
*
* @return array
......@@ -447,9 +447,7 @@ function editor_ckeditor_get_acf_settings($format) {
return array(TRUE, FALSE);
}
/**
* Converts Drupal-stored attribute values to CKEditor attribute lists.
*/
// Converts Drupal-stored attribute values to CKEditor attribute lists.
$get_attribute_values = function($attribute_values, $allowed_values) {
$values = array_keys(array_filter($attribute_values, function($value) use ($allowed_values) {
if ($allowed_values) {
......@@ -502,8 +500,8 @@ function editor_ckeditor_get_acf_settings($format) {
// attributes is allowed. However, that may not be the case: the "*"
// tag may still apply restrictions.
// Since CKEditor's ACF follows the following principle:
// Once validated, an element or its property cannot be
// invalidated by another rule.
// "Once validated, an element or its property cannot be invalidated by
// another rule."
// That means that the most permissive setting wins. Which means that
// it will still be allowed by CKEditor to e.g. define any style, no
// matter what the "*" tag's restrictions may be. If there's a setting
......
......@@ -17,7 +17,7 @@ function editor_ckeditor_settings_form(&$form, $form_state, $format) {
array('editor_ckeditor', 'drupal.editor_ckeditor.admin'),
),
'js' => array(
array('data' => array('ckeditor' => array('toolbarAdmin' => $toolbar_element)), 'type' => 'setting')
array('data' => array('ckeditor' => array('toolbarAdmin' => $toolbar_element)), 'type' => 'setting'),
),
),
'#attributes' => array('class' => array('ckeditor-toolbar-configuration')),
......@@ -141,7 +141,8 @@ function _editor_ckeditor_settings_parse_style_list($style_list_string) {
* Convert the stored array of styles into a string for editing.
*
* @param array $style_list
* The style list as returned by _ckeditor_ckeditor_settings_parse_style_list().
* The style list as returned by
* _ckeditor_ckeditor_settings_parse_style_list().
*
* @return string
* The string representation of the style list.
......
......@@ -162,7 +162,7 @@ function editor_ckeditor_editor_dialog_image_form($form, &$form_state, $format)
'#description' => t('Alternative text is required.<br />(Only in rare cases should this be left empty. To create empty alternative text, enter <code>""</code> — two double quotes without any content).'),
'#default_value' => $alt,
'#attributes' => array(
'placeholder' => t('Short description for the visually impaired')
'placeholder' => t('Short description for the visually impaired'),
),
'#parents' => array('attributes', 'alt'),
);
......@@ -179,7 +179,7 @@ function editor_ckeditor_editor_dialog_image_form($form, &$form_state, $format)
'#min' => 1,
'#max' => 99999,
'#attributes' => array(
'placeholder' => t('width')
'placeholder' => t('width'),
),
'#parents' => array('attributes', 'width'),
'#field_suffix' => ' &times; ',
......@@ -192,10 +192,10 @@ function editor_ckeditor_editor_dialog_image_form($form, &$form_state, $format)
'#min' => 1,
'#max' => 99999,
'#attributes' => array(
'placeholder' => t('height')
'placeholder' => t('height'),
),
'#parents' => array('attributes', 'height'),
'#field_suffix' => ' ' . t('pixels')
'#field_suffix' => ' ' . t('pixels'),
);
// Retrieve available filters and load all configured filters.
......@@ -303,7 +303,7 @@ function _editor_ckeditor_editor_dialog_link_url_validate(&$element, &$form_stat
form_set_value($element, $value, $form_state);
// Unlike
// Unlike.
if ($value !== '' && !valid_url($value, TRUE) && !valid_url($value, FALSE)) {
form_error($element, t('The URL %url is not valid.', array('%url' => $value)));
}
......
......@@ -73,7 +73,7 @@ function template_preprocess_editor_ckeditor_settings_toolbar(&$variables) {
$value = filter_xss_admin($button['image_alternative']);
}
elseif (isset($button['image'])) {
$value = '<img src="'. file_create_url($button['image' . $rtl]) . '" title="' . check_plain($button['label']) . '" />';
$value = '<img src="' . file_create_url($button['image' . $rtl]) . '" title="' . check_plain($button['label']) . '" />';
$value = '<a href="#" role="button" title="' . $button['label'] . '" aria-label="' . $button['label'] . '"><span class="cke_button_icon">' . $value . '</span></a>';
}
else {
......
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