diff --git a/views/handler_area.inc b/views/handler_area.inc index 1b9f938..a24ddb8 100644 --- a/views/handler_area.inc +++ b/views/handler_area.inc @@ -10,7 +10,9 @@ */ class ViewsSaveHandlerArea extends views_handler_area_text { - + /** + * {@inheritdoc} + */ public function option_definition() { $options = parent::option_definition(); @@ -23,7 +25,7 @@ public function option_definition() { } /** - * Defines a configuration form for this handler. + * {@inheritdoc} */ public function options_form(&$form, &$form_state) { parent::options_form($form, $form_state); diff --git a/views_save.admin.inc b/views_save.admin.inc index 7eebbd9..03751e6 100644 --- a/views_save.admin.inc +++ b/views_save.admin.inc @@ -118,12 +118,12 @@ function views_save_bundle_edit_submit_delete(array $form, array &$form_state) { } /** -* Form constructor for deleting a saved view type. -* -* @see views_save_bundle_delete_confirm_submit() -* -* @ingroup forms -*/ + * Form constructor for deleting a saved view type. + * + * @see views_save_bundle_delete_confirm_submit() + * + * @ingroup forms + */ function views_save_bundle_delete_confirm($form, &$form_state, $id) { $form_state['bundle'] = $id; $variables['%name'] = views_save_bundle_get_name($id); @@ -142,8 +142,8 @@ function views_save_bundle_delete_confirm($form, &$form_state, $id) { } /** -* Form submission handler for views_save_bundle_delete_confirm(). -*/ + * Form submission handler for views_save_bundle_delete_confirm(). + */ function views_save_bundle_delete_confirm_submit(array $form, array &$form_state) { views_save_bundle_delete($form_state['bundle']); $form_state['redirect'] = 'admin/structure/views_save'; diff --git a/views_save.install b/views_save.install index 68e3456..c535875 100644 --- a/views_save.install +++ b/views_save.install @@ -117,9 +117,9 @@ function views_save_install() { db_insert('views_save_bundle') ->fields(array( - 'id' => 'default', - 'label' => t('Default'), - )) + 'id' => 'default', + 'label' => t('Default'), + )) ->execute(); } diff --git a/views_save.js b/views_save.js index 1eb712b..d80a9df 100644 --- a/views_save.js +++ b/views_save.js @@ -1,3 +1,8 @@ +/** + * @file + * Provides Javascript functionality for the Views Save module. + */ + (function ($) { /** @@ -21,7 +26,10 @@ $form.hide(); - $('a.views-save-cancel', $form).click(function() {Drupal.CTools.Modal.dismiss(); return false;}); + $('a.views-save-cancel', $form).click(function () { + Drupal.CTools.Modal.dismiss(); + return false; + }); var id = $('.views-save-button-submit', $form).attr('id'); if (id) { diff --git a/views_save.module b/views_save.module index fb82788..1eaab8f 100644 --- a/views_save.module +++ b/views_save.module @@ -242,7 +242,7 @@ function views_save_user_login(&$edit, $account) { * This will associate all saved views that the anonymous user previously * created (in this session) with that account. * - * @param $account + * @param object $account * The account of the previously anonymous user. */ function views_save_user_add_saves($account) { @@ -426,7 +426,7 @@ function views_save_bundle_save($bundle, $is_new = FALSE) { /** * Deletes a saved view type. * - * @param $id + * @param string $id * The bundle's ID. * * @return bool @@ -585,7 +585,7 @@ function views_save_query_entity_field_access_alter(QueryAlterableInterface $que } /** - * Helper for access functions. + * Adds views_save entity access checks to the given query. * * @param QueryAlterableInterface $query * The query to add conditions to. @@ -597,8 +597,8 @@ function views_save_query_entity_field_access_alter(QueryAlterableInterface $que * @throws Exception * If the query doesn't contain the necessary columns. */ -// Stolen from _node_query_node_access_alter(). function _views_save_query_views_save_access_alter(QueryAlterableInterface $query, $type) { + // Stolen from _node_query_node_access_alter(). global $user; // Read meta-data from query, if provided. @@ -650,7 +650,6 @@ function _views_save_query_views_save_access_alter(QueryAlterableInterface $quer // Find all instances of the base table being joined -- could appear more than // once in the query, and could be aliased. - $filter = ($type == 'entity') ? db_and() : $query; foreach ($tables as $alias => $tableinfo) { $table = $tableinfo['table']; @@ -711,8 +710,6 @@ function _views_save_query_views_save_access_alter(QueryAlterableInterface $quer * The view which would be saved. * @param array $options * The options as set in the area handler. - * @param Entity $save - * If editing an existing saved view, the saved view to edit. NULL otherwise. * * @see views_save_form_validate() * @see views_save_form_submit() @@ -761,7 +758,6 @@ function views_save_form(array $form, array &$form_state, view $view, array $opt ); $form['#pre_render'][] = 'views_save_include_ctools_modal'; - // Set up the path/query combination that identifies this view. $query = drupal_get_query_parameters($_GET, array('q', 'page', 'views_save')); ksort($query); @@ -852,11 +848,11 @@ function views_save_form(array $form, array &$form_state, view $view, array $opt ); $form['path']['source'] = array( '#type' => 'value', - '#value' => $path['source'] + '#value' => $path['source'], ); $form['path']['language'] = array( '#type' => 'value', - '#value' => $path['language'] + '#value' => $path['language'], ); } @@ -893,8 +889,8 @@ function views_save_form(array $form, array &$form_state, view $view, array $opt '#attributes' => array( 'class' => array( 'element-invisible', - 'views-save-button-save' - ) + 'views-save-button-save', + ), ), ); @@ -1085,7 +1081,7 @@ function views_save_action_info() { * * Action callback used in views_save_action_info(). * - * @param $object + * @param object $object * The saved view to publish. * * @see actions_do() @@ -1099,7 +1095,7 @@ function views_save_publish($object) { * * Action callback used in views_save_action_info(). * - * @param $object + * @param object $object * The saved view to unpublish. * * @see actions_do() @@ -1111,11 +1107,11 @@ function views_save_unpublish($object) { /** * Determines whether the current user may delete the specified saved view. * - * @param $saved_view + * @param object $saved_view * The saved view to be deleted. * * @return bool - * TRUE if the operation may be performed, FALSE otherwise. + * TRUE if the operation may be performed, FALSE otherwise. */ function views_save_delete_access($saved_view) { global $user; @@ -1125,7 +1121,6 @@ function views_save_delete_access($saved_view) { return user_access('delete own views_save') && $user->uid == $saved_view->uid; } - /** * Form constructor for confirm the deletion of a saved view. * @@ -1145,7 +1140,7 @@ function views_save_delete_confirm($form, &$form_state, $saved_view) { return confirm_form($form, t('Are you sure you want to delete %title?', array('%title' => $saved_view->title)), views_save_path($saved_view), - t('Are you sure you want to delete %title?', array('%title' => $saved_view->title)) . t(' This action cannot be undone.'), + t('Are you sure you want to delete %title?', array('%title' => $saved_view->title)) . ' ' . t('This action cannot be undone.'), t('Delete') ); }