display-change.tcl

# This file displays details about an attachment

Location:
/packages/wp-slim/www/display-change.tcl
Author:
Haolan Qin <hqin@arsdigita.com>
Created:
Fri Dec 8 13:17:49 2000
CVS ID:
$Id: display-change.tcl,v 1.8 2015/06/27 20:34:41 gustafn Exp $

Related Files

[ hide source ] | [ make this the default ]

File Contents

# /packages/wp/www/attach-list.tcl

ad_page_contract {

    # This file displays details about an attachment

     @author Haolan Qin (hqin@arsdigita.com)
     @creation-date Fri Dec 8 13:17:49 2000
     @cvs-id $Id: display-change.tcl,v 1.8 2015/06/27 20:34:41 gustafn Exp $
} {
    slide_item_id:naturalnum,notnull
    attach_item_id:naturalnum,notnull
    revision_id:naturalnum,notnull
    display
    file_name:notnull
}

# DRB: This code actually should never be called except for images, since
# the user isn't allowed to change the display attribute for links (rather
# stupid, but that's the way it is).  Rather than allow the user the opportunity
# to try to make such a change, only to deny it with the following code, I've
# changed the calling page to suppress the option except for images...

# check mime type
set mime_type [db_string get_mime_type {
    select mime_type
    from cr_revisions
    where revision_id = :revision_id
}]

if { $display ne "" } {
    if { [cr_registered_type_for_mime_type $mime_type] ne "image" } {
    ad_return_complaint 1 "<li>[_ wp-slim.lt_The_file_is_neither_a]"
        ad_script_abort
    }
    db_dml display_change ""
}


ad_returnredirect [export_vars -base attach-detail {slide_item_id attach_item_id file_name}]