From c14f5026ff8a8930cb55abd9dcd91e1ad4df6d4b Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 14 Jul 2016 20:00:18 +0200 Subject: [PATCH] Add simple acl for media --- com.woltlab.wcf/objectType.xml | 8 +- com.woltlab.wcf/templates/__box.tpl | 4 +- com.woltlab.wcf/templates/aclSimple.tpl | 59 ++++ com.woltlab.wcf/templates/languageChooser.tpl | 5 +- com.woltlab.wcf/templates/mediaEditor.tpl | 66 +++-- com.woltlab.wcf/templates/mediaJavaScript.tpl | 1 - .../install/files/acp/templates/aclSimple.tpl | 24 +- .../files/acp/templates/languageChooser.tpl | 5 +- .../install/files/acp/templates/mediaAdd.tpl | 2 + .../files/acp/templates/mediaEditor.tpl | 46 ++-- .../files/acp/templates/mediaJavaScript.tpl | 1 - .../files/js/WoltLab/WCF/Media/Editor.js | 255 ++++++++---------- .../files/js/WoltLab/WCF/Ui/Acl/Simple.js | 18 +- .../lib/acp/form/MediaEditForm.class.php | 15 ++ .../content/ViewableArticleContent.class.php | 52 ++-- .../install/files/lib/data/box/Box.class.php | 81 +++--- .../files/lib/data/media/Media.class.php | 33 +-- .../lib/data/media/MediaAction.class.php | 21 +- .../lib/data/media/ViewableMedia.class.php | 26 ++ .../files/lib/page/MediaPage.class.php | 97 +------ .../box/AbstractBoxController.class.php | 7 - .../lib/system/box/IBoxController.class.php | 11 +- wcfsetup/install/files/style/ui/media.scss | 5 +- wcfsetup/install/lang/en.xml | 2 +- 24 files changed, 410 insertions(+), 434 deletions(-) create mode 100644 com.woltlab.wcf/templates/aclSimple.tpl diff --git a/com.woltlab.wcf/objectType.xml b/com.woltlab.wcf/objectType.xml index 92f027c6b6..6c726a2bd1 100644 --- a/com.woltlab.wcf/objectType.xml +++ b/com.woltlab.wcf/objectType.xml @@ -1059,7 +1059,7 @@ - + com.woltlab.wcf.page com.woltlab.wcf.acl.simple @@ -1068,7 +1068,11 @@ com.woltlab.wcf.box com.woltlab.wcf.acl.simple - + + com.woltlab.wcf.media + com.woltlab.wcf.acl.simple + + diff --git a/com.woltlab.wcf/templates/__box.tpl b/com.woltlab.wcf/templates/__box.tpl index d6a72d066d..81d06a6d1b 100644 --- a/com.woltlab.wcf/templates/__box.tpl +++ b/com.woltlab.wcf/templates/__box.tpl @@ -1,5 +1,5 @@ -<{if $box->showHeader}section{else}div{/if} class="box{if $box->hasImage()} boxWithImage{/if}{if $box->cssClassName} {$box->cssClassName}{/if}" data-box-identifier="{@$box->identifier}"> - {if $box->hasImage()} +<{if $box->showHeader}section{else}div{/if} class="box{if $box->getImage()} boxWithImage{/if}{if $box->cssClassName} {$box->cssClassName}{/if}" data-box-identifier="{@$box->identifier}"> + {if $box->getImage()}
{if $box->hasLink()} {@$box->getImage()} diff --git a/com.woltlab.wcf/templates/aclSimple.tpl b/com.woltlab.wcf/templates/aclSimple.tpl new file mode 100644 index 0000000000..3fa5a97cea --- /dev/null +++ b/com.woltlab.wcf/templates/aclSimple.tpl @@ -0,0 +1,59 @@ +{if !$__aclSimplePrefix|isset}{assign var='__aclSimplePrefix' value=''}{/if} + +
+
+
+
+
    +
  1. + + +
  2. +
  3. + + +
  4. +
+
+
+
+ + + + diff --git a/com.woltlab.wcf/templates/languageChooser.tpl b/com.woltlab.wcf/templates/languageChooser.tpl index b3fb0a854d..d537396a51 100644 --- a/com.woltlab.wcf/templates/languageChooser.tpl +++ b/com.woltlab.wcf/templates/languageChooser.tpl @@ -1,9 +1,10 @@ +{if !$__languageChooserPrefix|isset}{assign var='__languageChooserPrefix' value=''}{/if} {if !$label|isset}{assign var='label' value='wcf.user.language'}{/if} {if $languages|count}
{lang}{$label}{/lang}
-
+
- + {include file='languageChooser' label='wcf.media.languageID'} - +
-
+
- +
- {include file='multipleLanguageInputJavascript' elementIdentifier='title' forceSelection=true} - + {include file='multipleLanguageInputJavascript' elementIdentifier='title'|concat:'_':$media->mediaID forceSelection=true} +
-
+
- +
- {include file='multipleLanguageInputJavascript' elementIdentifier='caption' forceSelection=true} - + {include file='multipleLanguageInputJavascript' elementIdentifier='caption'|concat:'_':$media->mediaID forceSelection=true} +
-
+
- +
- {include file='multipleLanguageInputJavascript' elementIdentifier='altText' forceSelection=true} - + {include file='multipleLanguageInputJavascript' elementIdentifier='altText'|concat:'_':$media->mediaID forceSelection=true} + {event name='dataFields'} +{include file='aclSimple'} +
diff --git a/com.woltlab.wcf/templates/mediaJavaScript.tpl b/com.woltlab.wcf/templates/mediaJavaScript.tpl index ccac490856..76d9aae80d 100644 --- a/com.woltlab.wcf/templates/mediaJavaScript.tpl +++ b/com.woltlab.wcf/templates/mediaJavaScript.tpl @@ -11,7 +11,6 @@ 'wcf.media.insert.imageSize.original': '{lang}wcf.media.insert.imageSize.original{/lang}', 'wcf.media.manager': '{lang}wcf.media.manager{/lang}', 'wcf.media.edit': '{lang}wcf.media.edit{/lang}', - 'wcf.media.imageDimensions.value': '{lang __literal=true}wcf.media.imageDimensions.value{/lang}', 'wcf.media.button.insert': '{lang}wcf.media.button.insert{/lang}', 'wcf.media.search.filetype': '{lang}wcf.media.search.filetype{/lang}', 'wcf.media.search.noResults': '{lang}wcf.media.search.noResults{/lang}' diff --git a/wcfsetup/install/files/acp/templates/aclSimple.tpl b/wcfsetup/install/files/acp/templates/aclSimple.tpl index 35a2d2b897..0ddd8d3a2c 100644 --- a/wcfsetup/install/files/acp/templates/aclSimple.tpl +++ b/wcfsetup/install/files/acp/templates/aclSimple.tpl @@ -1,34 +1,36 @@ +{if !$__aclSimplePrefix|isset}{assign var='__aclSimplePrefix' value=''}{/if} +
-
+
  1. - - + +
  2. - - + +
-