Items now use H::T
This commit is contained in:
parent
9ba51985d7
commit
9aa26fa221
2 changed files with 19 additions and 23 deletions
File diff suppressed because one or more lines are too long
|
|
@ -34,7 +34,8 @@ sub duplicate {
|
||||||
$w = WebGUI::Wobject::Item->new({wobjectId=>$w,namespace=>$namespace});
|
$w = WebGUI::Wobject::Item->new({wobjectId=>$w,namespace=>$namespace});
|
||||||
$w->set({
|
$w->set({
|
||||||
linkURL=>$_[0]->get("linkURL"),
|
linkURL=>$_[0]->get("linkURL"),
|
||||||
attachment=>$_[0]->get("attachment")
|
attachment=>$_[0]->get("attachment"),
|
||||||
|
templateId=>$_[0]->get("templateId")
|
||||||
});
|
});
|
||||||
$f = WebGUI::Attachment->new($_[0]->get("attachment"),$_[0]->get("wobjectId"));
|
$f = WebGUI::Attachment->new($_[0]->get("attachment"),$_[0]->get("wobjectId"));
|
||||||
$f->copy($w->get("wobjectId"));
|
$f->copy($w->get("wobjectId"));
|
||||||
|
|
@ -42,18 +43,26 @@ sub duplicate {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub set {
|
sub set {
|
||||||
$_[0]->SUPER::set($_[1],[qw(linkURL attachment)]);
|
$_[0]->SUPER::set($_[1],[qw(linkURL attachment templateId)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_edit {
|
sub www_edit {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
my ($output, $f);
|
my ($output, $f, $template);
|
||||||
|
$template = $_[0]->get("templateId") || 1;
|
||||||
$output = helpIcon(1,$_[0]->get("namespace"));
|
$output = helpIcon(1,$_[0]->get("namespace"));
|
||||||
$output .= '<h1>'.WebGUI::International::get(6,$namespace).'</h1>';
|
$output .= '<h1>'.WebGUI::International::get(6,$namespace).'</h1>';
|
||||||
$f = WebGUI::HTMLForm->new;
|
$f = WebGUI::HTMLForm->new;
|
||||||
$f->url("linkURL",WebGUI::International::get(1,$_[0]->get("namespace")),$_[0]->get("linkURL"));
|
$f->url("linkURL",WebGUI::International::get(1,$_[0]->get("namespace")),$_[0]->get("linkURL"));
|
||||||
$f->raw($_[0]->fileProperty("attachment",2));
|
$f->raw($_[0]->fileProperty("attachment",2));
|
||||||
|
$f->template(
|
||||||
|
-name=>"templateId",
|
||||||
|
-value=>$template,
|
||||||
|
-namespace=>$namespace,
|
||||||
|
-label=>WebGUI::International::get(72,$namespace),
|
||||||
|
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
|
||||||
|
);
|
||||||
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly);
|
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly);
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
@ -73,25 +82,13 @@ sub www_editSave {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_view {
|
sub www_view {
|
||||||
my (@test, $output, $file);
|
my ($file, %var);
|
||||||
if ($_[0]->get("displayTitle")) {
|
|
||||||
$output = '<span class="itemTitle">'.$_[0]->get("title").'</span>';
|
|
||||||
if ($_[0]->get("linkURL")) {
|
|
||||||
$output = '<a href="'.$_[0]->get("linkURL").'">'.$output.'</span></a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($_[0]->get("attachment") ne "") {
|
if ($_[0]->get("attachment") ne "") {
|
||||||
$file = WebGUI::Attachment->new($_[0]->get("attachment"),$_[0]->get("wobjectId"));
|
$file = WebGUI::Attachment->new($_[0]->get("attachment"),$_[0]->get("wobjectId"));
|
||||||
if ($_[0]->get("displayTitle")) {
|
$var{attachmentURL} = $file->getURL;
|
||||||
$output .= ' - ';
|
$var{attachmentIcon} = $file->getIcon;
|
||||||
}
|
|
||||||
$output .= '<a href="'.$file->getURL.'"><img src="'.$file->getIcon.'" border=0 alt="'.
|
|
||||||
$_[0]->get("attachment").'" width=16 height=16 border=0 align="middle"></a>';
|
|
||||||
}
|
}
|
||||||
if ($_[0]->get("description") ne "") {
|
return $_[0]->processMacros($_[0]->processTemplate($_[0]->get("templateId"),\%var));
|
||||||
$output .= ' - '.$_[0]->get("description");
|
|
||||||
}
|
|
||||||
return $_[0]->processMacros($output);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue