Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-wiki
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-wiki
Commits
d6dc5f90
Commit
d6dc5f90
authored
Apr 14, 2005
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- removed unnecessary stuff
parent
aad2fc02
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
193 deletions
+18
-193
index.adp
www/admin/index.adp
+0
-63
index.tcl
www/admin/index.tcl
+18
-130
No files found.
www/admin/index.adp
View file @
d6dc5f90
<master>
<property name="title">@page_title@</property>
<p/>
<include src="../../../cms/www/bookmark" mount_point="@mount_point@" id="@parent_id@">
@page_title;noquote@
<p/>
<if @info.description@ not nil>@info.description@</if>
<else>No description</else>
<p/>
<include src="../../../cms/www/modules/sitemap/ancestors" item_id=@parent_id@
index_page_id=@index_page_id@
mount_point=@mount_point@>
<p/>
<listtemplate name="folder_items"></listtemplate>
<p/>
<br/>
<if @symlinks:rowcount@ gt 0>
<b>Links to this folder</b>:
<table border=0 cellpadding=4 cellspacing=0>
<multiple name=symlinks>
<tr><td>
<a href="index?id=@symlinks.id@">
<img src="../../resources/shortcut.gif" border=0>
@symlinks.path@
</a>
</td></tr>
</multiple>
</table>
<br>
</if>
<if @mount_point@ eq sitemap>
<if @num_revision_types@ gt 0>
<formtemplate id=add_item>
<img src="../../resources/Add24.gif" width=24 height=24 border=0>
<formwidget id=folder_id>
<formwidget id=mount_point>
Add a new <formwidget id=content_type> under this @what@.
<input type=submit value="Add Item">
</formtemplate><br>
</if>
</if>
<br>
<p>
<script language=JavaScript>
set_marks('@mount_point@', '../../resources/checked');
</script>
www/admin/index.tcl
View file @
d6dc5f90
...
...
@@ -7,7 +7,7 @@ ad_page_contract {
@author Michael Steigman
@creation-date October 2004
}
{
{
folder_id:integer
""
}
folder_id:integer
{
mount_point
"sitemap"
}
{
parent_id:integer
""
}
{
orderby
"title,asc"
}
...
...
@@ -18,76 +18,23 @@ set original_folder_id $folder_id
set
user_id
[
auth::require_login
]
set
root_id
[
cm::modules::$
{
mount_point
}
::getRootFolderID
]
# Get the folder label/description
# If :id does not exist, then use :root_id
if
{
[
template::util::is_nil folder_id
]
}
{
set parent_var :root_id
#set parent_id
$root
_id
set folder_id
$root
_id
permission::require_permission -party_id
$user
_id
\
-object_id
$folder
_id -privilege read
set module_name
[
db_string get_module_name
""
]
permission::require_permission -party_id
$user
_id
\
-object_id
$folder
_id -privilege admin
set info
(
label
)
$module
_name
set info
(
description
)
""
set what
"Folder"
set is_symlink f
set parent_var :folder_id
# get all the content types registered to this folder
# check whether this folder allows subfolders, symlinks, and templates
set registered_types
[
db_list get_reg_types
""
]
set subfolders_allowed f
set symlinks_allowed f
set templates_allowed f
if
{
[
lsearch
-exact
$registered
_types
"content_folder"
]
!= -1
}
{
set subfolders_allowed t
}
if
{
[
lsearch
-exact
$registered
_types
"content_symlink"
]
!= -1
}
{
set symlinks_allowed t
}
if
{
[
lsearch
-exact
$registered
_types
"content_template"
]
!= -1
}
{
set templates_allowed t
}
# Resolve the symlink, if any
set
resolved_id
[
db_string get_resolved_id
""
]
if
{
$resolved
_id !=
$folder
_id
}
{
set is_symlink t
set item_id
$resolved
_id
set what
"Link"
}
else
{
permission::require_permission -party_id
$user
_id
\
-object_id
$folder
_id -privilege read
set parent_var :folder_id
# Resolve the symlink, if any
set resolved_id
[
db_string get_resolved_id
""
]
if
{
$resolved
_id !=
$folder
_id
}
{
set is_symlink t
set item_id
$resolved
_id
set what
"Link"
}
else
{
set is_symlink f
set what
"Folder"
}
# get all the content types registered to this folder
# check whether this folder allows subfolders, symlinks, and templates
set registered_types
[
db_list get_types
""
]
set subfolders_allowed f
set symlinks_allowed f
set templates_allowed f
if
{
[
lsearch
-exact
$registered
_types
"content_folder"
]
!= -1
}
{
set subfolders_allowed t
}
if
{
[
lsearch
-exact
$registered
_types
"content_symlink"
]
!= -1
}
{
set symlinks_allowed t
}
if
{
[
lsearch
-exact
$registered
_types
"content_template"
]
!= -1
}
{
set templates_allowed t
}
set is_symlink f
set what
"Folder"
}
db_1row get_info
""
-column_array info
if
{
$info
(
parent_id
)
== 0
}
{
...
...
@@ -97,44 +44,24 @@ if { $info(parent_id) == 0 } {
set parent_id
$info
(
parent_id
)
}
# Get the index page ID
# Get the index page ID
set
index_page_id
[
db_string get_index_page_id
""
]
# symlinks to this folder/item
db_multirow symlinks get_symlinks
""
# build folder contents list
set
page_title
"Content Folder -
$info
(label)"
set
actions
"Attributes
[
export_vars -base attributes?mount_point=sitemap
{
folder_id
}]
\"
Folder Attributes
\"
"
if
{
[
permission::permission_p -party_id
$user
_id
\
-object_id
$folder
_id -privilege write
]
}
{
append actions
"
\"
Delete Folder
\"
[
export_vars -base delete?mount_point=sitemap
{
folder_id parent_id
}]
\"
Delete this folder
\"
\"
Rename Folder
\"
[
export_vars -base rename?mount_point=sitemap
{
folder_id
}]
\"
Rename this folder
\"
\"
New Folder
\"
[
export_vars -base create?mount_point=sitemap
{
folder_id
}]
\"
Create a new folder within this folder
\"
\"
Move Items
\"
[
export_vars -base move?mount_point=sitemap
{
folder_id
}]
\"
Move marked items to this folder
\"
\"
Copy Items
\"
[
export_vars -base copy?mount_point=sitemap
{
folder_id
}]
\"
Copy marked items to this folder
\"
\"
Link Items
\"
[
export_vars -base symlink?mount_point=sitemap
{
folder_id
}]
\"
Link marked items to this folder
\"
\"
Delete Items
\"
[
export_vars -base delete-items?mount_point=sitemap
{
folder_id
}]
\"
Delete marked items
\"
"
}
# set actions "Attributes [export_vars -base attributes?mount_point=sitemap {folder_id
}]
\"
Folder Attributes
\"
"
set actions
[
list
]
template::list::create
\
-name folder_items
\
-multirow folder_contents
\
-has_checkboxes
\
-key item_id
\
-page_size
2
0
\
-page_size
5
0
\
-page_query_name get_folder_contents_paginate
\
-actions
$actions
\
-elements {
copy
{
label
"Clipboard"
display_template
"<center>@folder_contents.copy;noquote@</center>"
}
title {
label "
Name
"
link_html { title "
View this item
"}
...
...
@@ -167,6 +94,7 @@ template::list::create \
mount_point {}
}
db_multirow -extend { item_url copy file_size } folder_contents get_folder_contents "" {
switch
$content
_type {
content_folder {
...
...
@@ -185,43 +113,3 @@ db_multirow -extend { item_url copy file_size } folder_contents get_folder_conte
set copy
[
clipboard::render_bookmark sitemap
$item
_id
[
ad_conn package_url
]]
}
form create add_item
if
{
[
template::util::is_nil original_folder_id
]
}
{
set the_id
$root
_id
}
else
{
set the_id
$original
_folder_id
}
element create add_item folder_id
\
-datatype integer -widget hidden -param -optional
element create add_item mount_point
\
-datatype string -widget hidden -param -optional
set
revision_types
[
cms_folder::get_registered_types
$the
_id
]
set
num_revision_types
[
llength
$revision
_types
]
element create add_item content_type
\
-datatype keyword
\
-widget select
\
-label
"Content Type"
\
-options
$revision
_types
if
{
[
form is_valid add_item
]
}
{
form get_values add_item folder_id mount_point content_type
# if the folder_id is empty,
then
it must be the root folder
if
{
[
template::util::is_nil folder_id
]
}
{
set folder_id
[
cm::modules::$
{
mount_point
}
::getRootFolderID
]
}
else
{
set folder_id
$original
_folder_id
}
if
{
[
string
equal
$mount
_point
"templates"
]
}
{
forward
"../items/template?parent_id=
$folder
_id&mount_point=
$mount
_point"
}
else
{
forward
"../items/create-1?parent_id=
$folder
_id&mount_point=
$mount
_point&content_type=
$content
_type"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment