Plugin Directory

Changeset 1386771


Ignore:
Timestamp:
04/05/2016 01:20:19 AM (10 years ago)
Author:
derekheld
Message:

Further work getting the settings page to be useful enough for further development

File:
1 edited

Legend:

Unmodified
Added
Removed
  • blue-storage/branches/2.0.0/class-blue-storage-settings.php

    r1385806 r1386771  
    4545            self::delete_files_form();
    4646        }
     47
     48        if( BlueStorageConst::ALLOW_COPY_TO_AZURE )
     49        {
     50            self::copy_to_azure_form();
     51        }
     52       
    4753        echo '<form method="post" action="options.php">';
    4854        do_settings_sections(self::$PluginOptionsPage);
     
    7278        register_setting( self::$BlueStorageSettingsGroup, self::$MaxCacheSlug );
    7379        register_setting( self::$BlueStorageSettingsGroup, self::$CnameSlug );
     80    }
     81
     82    public static function copy_to_azure_form( )
     83    {
     84        echo '<form name="CopyToAzure" style="margin: 20px;" method="post" action="'.$_SERVER['REQUEST_URI'].'">
     85            <input type="hidden" name="CopyToAzure" value="true" />
     86            <input type="hidden" name="selected_container" value="'.get_option('default_azure_storage_account_container_name').'/>
     87            <label style="font-weight: bold;">Copy local media to "'.get_option('default_azure_storage_account_container_name').'" container</label>
     88            <br/>Be careful running this. This can take a long time to finish. Make sure your PHP script execution time limit allows you enough time.
     89            <br/>If the script is stopped before finishing the current file it is working on may be broken and have to be deleted and reuploaded.
     90            <br/>The process will also attempt to fix any newly broken links. It may not fix everything and you may have links that break.
     91            <br/>
     92            <br/>Yes, I really want to start copying files. I know it is possible that something could break. <input type=checkbox name="confirm"/>
     93            <br/>
     94            <label>Batch size <input type="number" name="image_count" min="0" max="100" step="1" value="25" /></label>
     95            <br/>
     96            <input type="submit" value="Copy To Azure" id="blue-storage-green-button"/>
     97        </form>';
    7498    }
    7599
Note: See TracChangeset for help on using the changeset viewer.