Version: current

     1 <?php
     2
     3
     4 class AssetAdminQuotaExtension extends Extension {
     5
     6     function extraStatics() {
     7     }
     8
     9     function updateUploadForm(& $form) {
    10         $sizeInfo = LeftAndMainQuota::sizeStatus();
    11         if ($sizeInfo->Blocked) {
    12             $form->Fields()->removeByName('UploadButton');
    13             $form->Fields()->removeByName('Files[0]');
    14             $form->Fields()->removeByName('MultifileCode');
    15             $form->Fields()->insertAfter(new LiteralField('Quota', '<div style="color: red; margin: 8px 4px; float: left; font-size: 18px;">'._t('AssetAdmin.QuotaExceded', 'Quota Exceded').'</div>'), 'FolderID');
    16
    17         }
    18     }
    19 }

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -