You are here

function s3fs_actions in S3 File System 7

Same name and namespace in other branches
  1. 7.3 s3fs.admin.inc \s3fs_actions()
  2. 7.2 s3fs.admin.inc \s3fs_actions()

Builds the Actions form.

1 string reference to 's3fs_actions'
s3fs_menu in ./s3fs.module
Implements hook_menu().

File

./s3fs.admin.inc, line 264
Administration form setup for S3 File System.

Code

function s3fs_actions() {
  $form = array();
  $form['s3fs_refresh_cache'] = array(
    '#type' => 'fieldset',
    '#description' => t("The file metadata cache keeps track of every file that S3 File System writes to (and deletes from) the S3 bucket,\n      so that queries for data about those files (checks for existence, filetype, etc.) don't have to hit S3.\n      This speeds up many operations, most noticeably anything related to images and their derivatives."),
    '#title' => t('File Metadata Cache'),
  );
  $refresh_description = t("This button queries S3 for the metadata of <i><b>all</b></i> the files in your site's bucket, and saves it to the\n    database. This may take a while for buckets with many thousands of files. <br>\n    It should only be necessary to use this button if you've just installed S3 File System and you need to cache all the\n    pre-existing files in your bucket, or if you need to restore your metadata cache from scratch for some other reason.");
  $form['s3fs_refresh_cache']['refresh'] = array(
    '#type' => 'submit',
    '#suffix' => '<div class="refresh">' . $refresh_description . '</div>',
    '#value' => t('Refresh file metadata cache'),
    '#attached' => array(
      'css' => array(
        // Push the button closer to its own description, and push the disable
        // checkbox away from the description.
        '#edit-refresh {margin-bottom: 0; margin-top: 1em;} div.refresh {margin-bottom: 1em;}' => array(
          'type' => 'inline',
        ),
      ),
    ),
    '#submit' => array(
      '_s3fs_refresh_cache_submit',
    ),
  );
  return $form;
}