Plugin Directory

Changeset 1385806


Ignore:
Timestamp:
04/03/2016 11:45:55 PM (10 years ago)
Author:
derekheld
Message:

Added CNAME option, form for deleting all uploads

File:
1 edited

Legend:

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

    r1385690 r1385806  
    2626    public static $AzureAsDefaultUploadSlug = 'azure_storage_use_for_default_upload';
    2727    public static $MaxCacheSlug = 'max_cache';
     28    public static $CnameSlug = 'cname';
    2829
    2930    public static function init()
     
    4041    public static function options_page()
    4142    {
     43        if( BlueStorageConst::ALLOW_DELETE_ALL )
     44        {
     45            self::delete_files_form();
     46        }
    4247        echo '<form method="post" action="options.php">';
    4348        do_settings_sections(self::$PluginOptionsPage);
     
    5863        add_settings_field( self::$AzureAsDefaultUploadSlug, 'Use Azure Storage by default', array(get_called_class(), 'input_callback'), self::$PluginOptionsPage, self::$BlueStorageSettingsGroup, array('slug' => self::$AzureAsDefaultUploadSlug, 'type'=> 'checkbox') );
    5964        add_settings_field( self::$MaxCacheSlug, 'Max cache timeout', array(get_called_class(), 'input_callback'), self::$PluginOptionsPage, self::$BlueStorageSettingsGroup, array('slug' => self::$MaxCacheSlug, 'type' => 'text') );
     65        add_settings_field( self::$CnameSlug, 'URL CNAME', array(get_called_class(), 'input_callback'), self::$PluginOptionsPage, self::$BlueStorageSettingsGroup, array('slug' => self::$CnameSlug, 'type' => 'text') );
    6066
    6167        //Now register all the settings
     
    6571        register_setting( self::$BlueStorageSettingsGroup, self::$AzureAsDefaultUploadSlug );
    6672        register_setting( self::$BlueStorageSettingsGroup, self::$MaxCacheSlug );
     73        register_setting( self::$BlueStorageSettingsGroup, self::$CnameSlug );
    6774    }
    6875
     
    120127    }
    121128
     129    public static function delete_files_form()
     130    {
     131        echo '<form name = "DeleteAllBlobsForm" style = "margin: 20px;" method = "post" action = "'.$_SERVER['REQUEST_URI'].'">
     132            <input type = "hidden" name = "DeleteAllBlobs" value = "true" />
     133            <input type = "hidden" name = "selected_container" value='.get_option('default_azure_storage_account_container_name').'/>
     134            <label style = "font-weight: bold;" > Delete all uploaded files from this site in "'.get_option('default_azure_storage_account_container_name').'"</label >
     135            <br/>Yes, I really want to <span id="blue-storage-warning">delete everything</span>. I know this is irreversable. <input type = checkbox name = "confirm"/>
     136            <br/>
     137            <input type = "submit" value = "Delete All Files" id="blue-storage-red-button"/>
     138        </form>';
     139    }
     140
    122141    public static function delete_all_uploads()
    123142    {
Note: See TracChangeset for help on using the changeset viewer.