package WebGUI::Wobject::Item; #------------------------------------------------------------------- # WebGUI is Copyright 2001-2002 Plain Black LLC. #------------------------------------------------------------------- # Please read the legal notices (docs/legal.txt) and the license # (docs/license.txt) that came with this distribution before using # this software. #------------------------------------------------------------------- # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- use strict; use Tie::CPHash; use WebGUI::Attachment; use WebGUI::HTMLForm; use WebGUI::Icon; use WebGUI::International; use WebGUI::Privilege; use WebGUI::Session; use WebGUI::SQL; use WebGUI::URL; use WebGUI::Utility; use WebGUI::Wobject; our @ISA = qw(WebGUI::Wobject); our $namespace = "Item"; our $name = WebGUI::International::get(4,$namespace); #------------------------------------------------------------------- sub duplicate { my ($w, $f); $w = $_[0]->SUPER::duplicate($_[1]); $w = WebGUI::Wobject::Item->new({wobjectId=>$w,namespace=>$namespace}); $w->set({ linkURL=>$_[0]->get("linkURL"), attachment=>$_[0]->get("attachment"), templateId=>$_[0]->get("templateId") }); $f = WebGUI::Attachment->new($_[0]->get("attachment"),$_[0]->get("wobjectId")); $f->copy($w->get("wobjectId")); } #------------------------------------------------------------------- sub set { $_[0]->SUPER::set($_[1],[qw(linkURL attachment templateId)]); } #------------------------------------------------------------------- sub www_edit { return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage()); my ($output, $f, $template); $template = $_[0]->get("templateId") || 1; $output = helpIcon(1,$_[0]->get("namespace")); $output .= '