diff --git a/code/DMSDocument.php b/code/DMSDocument.php index 3adf294..c182579 100644 --- a/code/DMSDocument.php +++ b/code/DMSDocument.php @@ -448,7 +448,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface { new GridFieldSortableHeader(), new GridFieldDataColumns(), new GridFieldPaginator(30), - new GridFieldEditButton(), + //new GridFieldEditButton(), new GridFieldDetailForm() ); $gridFieldConfig->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('Title'=>'Title','ClassName'=>'Page Type','ID'=>'Page ID')); @@ -468,6 +468,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface { $actions->setName('DMSActions'); $fields->add($actions);*/ + $fields->add(new LiteralField('BottomTaskSelection',"
")); $fields->add($UploadField); $fields->add($pagesGrid); $fields->add(FormAction::create('dod', _t('GridFieldDetailForm.Delete', 'Delete')) @@ -480,20 +481,20 @@ class DMSDocument extends DataObject implements DMSDocumentInterface { /** * Return the relative URL of an icon for the file type, * based on the {@link appCategory()} value. - * Images are searched for in "framework/images/app_icons/". + * Images are searched for in "dms/images/app_icons/". * * @return String */ function Icon($ext) { - if(!Director::fileExists(FRAMEWORK_DIR . "/images/app_icons/{$ext}_32.gif")) { + if(!Director::fileExists("dms/images/app_icons/{$ext}_32.png")) { $ext = File::get_app_category($ext); } - if(!Director::fileExists(FRAMEWORK_DIR . "/images/app_icons/{$ext}_32.gif")) { + if(!Director::fileExists("dms/images/app_icons/{$ext}_32.png")) { $ext = "generic"; } - return FRAMEWORK_DIR . "/images/app_icons/{$ext}_32.gif"; + return "dms/images/app_icons/{$ext}_32.png"; } /** diff --git a/css/DMSDocumentCMSFields.css b/css/DMSDocumentCMSFields.css index 0cc0204..0c67857 100644 --- a/css/DMSDocumentCMSFields.css +++ b/css/DMSDocumentCMSFields.css @@ -1 +1,9 @@ -#test { /* Test SCSS */ } +#FileP .fieldgroup-field { width: 100%; } +#FileP .fieldgroup-field .cms-file-info-data { width: 400px; } +#FileP .fieldgroup-field .fieldholder-small { margin-top: 5px; } +#FileP .fieldgroup-field .fieldholder-small label { width: auto; margin-left: 0; padding-top: 0; margin-right: 10px; font-weight: bold; } +#FileP .fieldgroup-field .fieldholder-small .readonly { font-style: italic; color: #666; } + +#DocumentTypeID ul input[type="radio"] { display: none; } +#DocumentTypeID ul li { display: inline; float: none; padding: 4px; } +#DocumentTypeID ul li.selected { border-bottom: 1px solid #555; border-top: 1px solid #e6e6e6; } diff --git a/images/app_icons/jpeg_32.png b/images/app_icons/jpeg_32.png new file mode 100755 index 0000000..6d28947 Binary files /dev/null and b/images/app_icons/jpeg_32.png differ diff --git a/images/app_icons/pdf_32.png b/images/app_icons/pdf_32.png new file mode 100755 index 0000000..390bed9 Binary files /dev/null and b/images/app_icons/pdf_32.png differ diff --git a/images/app_icons/zip_32.png b/images/app_icons/zip_32.png new file mode 100755 index 0000000..f20f96b Binary files /dev/null and b/images/app_icons/zip_32.png differ diff --git a/javascript/DMSDocumentCMSFields.js b/javascript/DMSDocumentCMSFields.js index 4cced54..63224d2 100644 --- a/javascript/DMSDocumentCMSFields.js +++ b/javascript/DMSDocumentCMSFields.js @@ -2,5 +2,37 @@ $.entwine('ss', function($) { + $('#DocumentTypeID ul li').entwine({ + onmatch: function() { + this.addClass('ss-ui-button'); + }, + }); + + $('#DocumentTypeID ul li').entwine({ + onclick: function(e) { + if ($('input[type=radio]:checked').length > 0) { + this.addClass('selected'); + } + //not.(this).removeClass('selected'); + /* e.preventDefault(); + this.parents('.cms-preview').loadUrl(this.attr('href')); + this.addClass('disabled'); + this.parents('.cms-preview-states').find('a').not(this).removeClass('disabled'); + //This hides all watermarks + this.parents('.cms-preview-states').find('.cms-preview-watermark').hide(); + //Show the watermark for the current state + this.siblings('.cms-preview-watermark').show();*/ + }, + }); + + $('#Actions ul li').entwine({ + onclick: function(e) { + e.preventDefault(); + this.parents('fieldset').find('#ReplaceFile').hide(); + } + }); + + }); -}); \ No newline at end of file + +}(jQuery)); \ No newline at end of file diff --git a/scss/DMSDocumentCMSFields.scss b/scss/DMSDocumentCMSFields.scss index ba34763..d0fa89e 100644 --- a/scss/DMSDocumentCMSFields.scss +++ b/scss/DMSDocumentCMSFields.scss @@ -1,3 +1,43 @@ -#test { - /* Test SCSS */ +#FileP{ + .fieldgroup-field{ + width:100%; + .cms-file-info-data{ + width:400px; + } + .fieldholder-small{ + margin-top: 5px; + label{ + width:auto; + margin-left: 0; + padding-top: 0; + margin-right: 10px; + font-weight: bold; + } + .readonly{ + font-style:italic; + color: #666; + } + } + } +} + +#DocumentTypeID{ + ul{ + input[type="radio"]{ + display:none; + } + li{ + display:inline; + float: none; + padding:4px; + &.selected{ + border-bottom:1px solid #555; + border-top:1px solid #e6e6e6; + } + label{ + //display: inline-block; + //padding: 4px 10px; + } + } + } } \ No newline at end of file