Skip to content

Commit

Permalink
Address feedback from PR at #60
Browse files Browse the repository at this point in the history
Eric Wagner committed Feb 8, 2021
1 parent 0a740ae commit 0f641a8
Showing 7 changed files with 27 additions and 26 deletions.
3 changes: 3 additions & 0 deletions App_LocalResources/ucViewOptions.ascx.resx
Original file line number Diff line number Diff line change
@@ -1140,6 +1140,9 @@
<data name="UseStaticTagsList.Text" xml:space="preserve">
<value>Use Static Tags List</value>
</data>
<data name="UseStaticTagsList.Help" xml:space="preserve">
<value>Check to only allow existing tags to be used on submit article screen, otherwise allow article authors to create new tags while authoring an article. When checked, a list box will be used to select existing tags (similar to categories), rather then the text box used when unchecked.</value>
</data>
<data name="AllGroups.Text" xml:space="preserve">
<value>-- All Groups -- </value>
</data>
10 changes: 5 additions & 5 deletions Components/ArticleSettings.vb
Original file line number Diff line number Diff line change
@@ -244,12 +244,12 @@ Namespace Ventrian.NewsArticles
End Get
End Property

Public ReadOnly Property UseStaticTagsListSubmit() As Boolean
Public ReadOnly Property UseStaticTagsList() As Boolean
Get
If (Settings.Contains(ArticleConstants.USE_STATIC_TAGS_LIST_SUBMIT_SETTING)) Then
Return Convert.ToBoolean(Settings(ArticleConstants.USE_STATIC_TAGS_LIST_SUBMIT_SETTING).ToString())
If (Settings.Contains(ArticleConstants.USE_STATIC_TAGS_LIST_SETTING)) Then
Return Convert.ToBoolean(Settings(ArticleConstants.USE_STATIC_TAGS_LIST_SETTING).ToString())
Else
Return ArticleConstants.USE_STATIC_TAGS_LIST_SUBMIT_SETTING_DEFAULT
Return ArticleConstants.USE_STATIC_TAGS_LIST_SETTING_DEFAULT
End If
End Get
End Property
@@ -365,7 +365,7 @@ Namespace Ventrian.NewsArticles
End If
End Get
End Property

Public ReadOnly Property EnablePortalFiles() As Boolean
Get
If (Settings.Contains(ArticleConstants.ENABLE_PORTAL_FILES_SETTING)) Then
4 changes: 2 additions & 2 deletions Components/Common/ArticleConstants.vb
Original file line number Diff line number Diff line change
@@ -113,8 +113,8 @@ Namespace Ventrian.NewsArticles
Public Const CATEGORY_FILTER_SUBMIT_SETTING_DEFAULT As Boolean = False
Public Const CATEGORY_SORT_SETTING As String = "CategorySortType"
Public Const CATEGORY_SORT_SETTING_DEFAULT As CategorySortType = CategorySortType.SortOrder
Public Const USE_STATIC_TAGS_LIST_SUBMIT_SETTING As String = "UseStaticTagsList"
Public Const USE_STATIC_TAGS_LIST_SUBMIT_SETTING_DEFAULT As Boolean = False
Public Const USE_STATIC_TAGS_LIST_SETTING As String = "UseStaticTagsList"
Public Const USE_STATIC_TAGS_LIST_SETTING_DEFAULT As Boolean = False


' Category Security Settings
26 changes: 12 additions & 14 deletions ucSubmitNews.ascx.vb
Original file line number Diff line number Diff line change
@@ -192,7 +192,7 @@ Namespace Ventrian.NewsArticles
End If
Next

If (ArticleSettings.UseStaticTagsListSubmit) Then
If (ArticleSettings.UseStaticTagsList) Then
SelectTags(objArticle.Tags)
Else
txtTags.Text = objArticle.Tags
@@ -343,7 +343,7 @@ Namespace Ventrian.NewsArticles
End Sub

Private Sub BindTags()
If (ArticleSettings.UseStaticTagsListSubmit) Then
If (ArticleSettings.UseStaticTagsList) Then
txtTags.Visible = False
lblTags.Visible = False

@@ -360,15 +360,13 @@ Namespace Ventrian.NewsArticles

Private Sub SelectTags(ByVal tagList As String)
Dim objTagController As New TagController
For Each tag As String In tagList.Split(","c)
If (tag <> "") Then
Dim objTag As TagInfo = objTagController.Get(ModuleId, tag)

If Not (objTag Is Nothing) Then
Dim li As ListItem = lstTags.Items.FindByValue(objTag.Name)
If Not (li Is Nothing) Then
li.Selected = True
End If
For Each tag As String In tagList.Split(New Char() {","c}, StringSplitOptions.RemoveEmptyEntries)
Dim objTag As TagInfo = objTagController.Get(ModuleId, tag)

If objTag IsNot Nothing Then
Dim li As ListItem = lstTags.Items.FindByValue(objTag.Name)
If li IsNot Nothing Then
li.Selected = True
End If
End If
Next
@@ -1183,7 +1181,7 @@ Namespace Ventrian.NewsArticles
Dim objLinkedArticle As ArticleInfo = objArticleController.GetArticle(Convert.ToInt32(drpMirrorArticle.SelectedValue))

If (objLinkedArticle IsNot Nothing) Then
If (ArticleSettings.UseStaticTagsListSubmit) Then
If (ArticleSettings.UseStaticTagsList) Then
SelectTags(objLinkedArticle.Tags)
Else
txtTags.Text = objLinkedArticle.Tags
@@ -1194,12 +1192,12 @@ Namespace Ventrian.NewsArticles
Dim objTagController As New TagController
objTagController.DeleteArticleTag(articleID)

If (ArticleSettings.UseStaticTagsListSubmit) Then
If (ArticleSettings.UseStaticTagsList) Then
For Each li As ListItem In lstTags.Items
If (li.Selected) Then
Dim objTag As TagInfo = objTagController.Get(ModuleId, li.Value)

If Not (objTag Is Nothing) Then
If objTag IsNot Nothing Then
objTagController.Add(articleID, objTag.TagID)
End If
End If
2 changes: 1 addition & 1 deletion ucViewOptions.ascx
Original file line number Diff line number Diff line change
@@ -182,7 +182,7 @@
<table id="tblTags" cellspacing="2" cellpadding="2" summary="Appearance Design Table"
border="0" runat="server">
<tr>
<td class="SubHead" width="200"><dnn:label id="Label12" runat="server" resourcekey="UseStaticTagsList" controlname="chkUseStaticTagsList"></dnn:label></td>
<td class="SubHead" width="200"><dnn:label id="plUseStaticTagsList" runat="server" resourcekey="UseStaticTagsList" controlname="chkUseStaticTagsList"></dnn:label></td>
<td valign="top"><asp:checkbox id="chkUseStaticTagsList" Runat="server" CssClass="NormalTextBox"></asp:checkbox></td>
</tr>
</table>
4 changes: 2 additions & 2 deletions ucViewOptions.ascx.designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ucViewOptions.ascx.vb
Original file line number Diff line number Diff line change
@@ -523,7 +523,7 @@ Namespace Ventrian.NewsArticles
chkCategoryBreadcrumb.Checked = ArticleSettings.CategoryBreadcrumb
chkCategoryName.Checked = ArticleSettings.IncludeInPageName
chkCategoryFilterSubmit.Checked = ArticleSettings.CategoryFilterSubmit
chkUseStaticTagsList.Checked = ArticleSettings.UseStaticTagsListSubmit
chkUseStaticTagsList.Checked = ArticleSettings.UseStaticTagsList

If (lstCategorySortOrder.Items.FindByValue(ArticleSettings.CategorySortType.ToString()) IsNot Nothing) Then
lstCategorySortOrder.SelectedValue = ArticleSettings.CategorySortType.ToString()
@@ -554,7 +554,7 @@ Namespace Ventrian.NewsArticles
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.CATEGORY_BREADCRUMB_SETTING, chkCategoryBreadcrumb.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.CATEGORY_NAME_SETTING, chkCategoryName.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.CATEGORY_FILTER_SUBMIT_SETTING, chkCategoryFilterSubmit.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.USE_STATIC_TAGS_LIST_SUBMIT_SETTING, chkUseStaticTagsList.Checked.ToString())
objModules.UpdateModuleSetting(ModuleId, ArticleConstants.USE_STATIC_TAGS_LIST_SETTING, chkUseStaticTagsList.Checked.ToString())

objModules.UpdateModuleSetting(ModuleId, ArticleConstants.CATEGORY_SORT_SETTING, lstCategorySortOrder.SelectedValue)

0 comments on commit 0f641a8

Please sign in to comment.