Merge branch 'WebGUI8' of github.com:plainblack/webgui into 8
Conflicts: lib/WebGUI.pm lib/WebGUI/Auth/WebGUI.pm sbin/findBrokenAssets.pl sbin/testEnvironment.pl
This commit is contained in:
commit
677ac978b6
89 changed files with 1064 additions and 448 deletions
|
|
@ -2425,7 +2425,7 @@ ENDJS
|
|||
|
||||
|
||||
### Show the processed template
|
||||
$session->http->sendHeader;
|
||||
$session->response->sendHeader;
|
||||
my $style = $self->getParent->processStyle($self->getSeparator);
|
||||
my ($head, $foot) = split($self->getSeparator,$style);
|
||||
$self->session->output->print($head, 1);
|
||||
|
|
@ -2461,8 +2461,8 @@ sub www_view {
|
|||
return $self->session->privilege->noAccess() unless $self->canView;
|
||||
my $check = $self->checkView;
|
||||
return $check if (defined $check);
|
||||
$self->session->http->setCacheControl($self->getParent->visitorCacheTimeout) if ($self->session->user->isVisitor);
|
||||
$self->session->http->sendHeader;
|
||||
$self->session->response->setCacheControl($self->getParent->visitorCacheTimeout) if ($self->session->user->isVisitor);
|
||||
$self->session->response->sendHeader;
|
||||
$self->prepareView;
|
||||
my $style = $self->getParent->processStyle($self->getSeparator);
|
||||
my ($head, $foot) = split($self->getSeparator,$style);
|
||||
|
|
|
|||
|
|
@ -667,9 +667,10 @@ sub www_view {
|
|||
return sprintf($i18n->get("file not found"), $self->getUrl());
|
||||
}
|
||||
|
||||
$session->http->setRedirect($self->getFileUrl) unless $session->config->get('enableStreamingUploads');
|
||||
$session->http->setStreamedFile($self->getStorageLocation->getPath($self->filename));
|
||||
$session->http->sendHeader;
|
||||
# sendFile does either a redirect or starts a stream depending on how we're configured
|
||||
|
||||
$session->response->sendFile($self->getStorageLocation, $self->filename);
|
||||
|
||||
return 'chunked';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1154,8 +1154,8 @@ sub www_view {
|
|||
# Add to views
|
||||
$self->update({ views => $self->views + 1 });
|
||||
|
||||
$self->session->http->setLastModified($self->getContentLastModified);
|
||||
$self->session->http->sendHeader;
|
||||
$self->session->response->setLastModified($self->getContentLastModified);
|
||||
$self->session->response->sendHeader;
|
||||
$self->prepareView;
|
||||
my $style = $self->processStyle($self->getSeparator);
|
||||
my ($head, $foot) = split($self->getSeparator,$style);
|
||||
|
|
|
|||
|
|
@ -548,7 +548,7 @@ sub www_download {
|
|||
my $storage = $self->getStorageLocation;
|
||||
|
||||
$self->session->response->content_type( "image/jpeg" );
|
||||
$self->session->http->setLastModified( $self->getContentLastModified );
|
||||
$self->session->response->setLastModified( $self->getContentLastModified );
|
||||
|
||||
my $resolution = $self->session->form->get("resolution");
|
||||
if ($resolution) {
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ sub www_view {
|
|||
if ($self->session->isAdminOn) {
|
||||
return $self->session->asset($self->getContainer)->www_view;
|
||||
}
|
||||
$self->session->http->setRedirect($self->getFileUrl($self->showPage));
|
||||
$self->session->response->setRedirect($self->getFileUrl($self->showPage));
|
||||
return "1";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ so that this point is automatically shown.
|
|||
sub www_view {
|
||||
my $self = shift;
|
||||
|
||||
$self->session->http->setRedirect(
|
||||
$self->session->response->setRedirect(
|
||||
$self->getParent->getUrl('focusOn=' . $self->getId )
|
||||
);
|
||||
return "redirect";
|
||||
|
|
|
|||
|
|
@ -785,10 +785,10 @@ sub www_click {
|
|||
|
||||
$self->incrementCounter('clicks');
|
||||
if ($session->form->process("manufacturer")) {
|
||||
$session->http->setRedirect( $self->get('manufacturerURL') );
|
||||
$session->response->setRedirect( $self->get('manufacturerURL') );
|
||||
}
|
||||
else {
|
||||
$session->http->setRedirect( $self->get('productURL') );
|
||||
$session->response->setRedirect( $self->get('productURL') );
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1445,20 +1445,20 @@ Renders self->view based upon current style, subject to timeouts. Returns Privil
|
|||
=cut
|
||||
|
||||
sub www_view {
|
||||
my $self = shift;
|
||||
my $currentPost = shift;
|
||||
return $self->session->privilege->noAccess() unless $self->canView;
|
||||
my $check = $self->checkView;
|
||||
return $check if (defined $check);
|
||||
$self->session->http->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor);
|
||||
$self->session->http->sendHeader;
|
||||
$self->prepareView;
|
||||
my $style = $self->getParent->processStyle($self->getSeparator);
|
||||
my ($head, $foot) = split($self->getSeparator,$style);
|
||||
$self->session->output->print($head,1);
|
||||
$self->session->output->print($self->view($currentPost));
|
||||
$self->session->output->print($foot,1);
|
||||
return "chunked";
|
||||
my $self = shift;
|
||||
my $currentPost = shift;
|
||||
return $self->session->privilege->noAccess() unless $self->canView;
|
||||
my $check = $self->checkView;
|
||||
return $check if (defined $check);
|
||||
$self->session->response->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor);
|
||||
$self->session->response->sendHeader;
|
||||
$self->prepareView;
|
||||
my $style = $self->getParent->processStyle($self->getSeparator);
|
||||
my ($head, $foot) = split($self->getSeparator,$style);
|
||||
$self->session->output->print($head,1);
|
||||
$self->session->output->print($self->view($currentPost));
|
||||
$self->session->output->print($foot,1);
|
||||
return "chunked";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ sub exportHtml_view {
|
|||
my $url = $self->redirectUrl;
|
||||
WebGUI::Macro::process($self->session, \$url);
|
||||
return '' if ($url eq $self->url);
|
||||
$self->session->http->setRedirect($url);
|
||||
$self->session->response->setRedirect($url);
|
||||
return $self->session->style->process('', 'PBtmpl0000000000000060');
|
||||
}
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ sub www_view {
|
|||
</ul>',$i18n->get("assetName"));
|
||||
}
|
||||
unless ($url eq $self->url) {
|
||||
$self->session->http->setRedirect($url,$self->redirectType);
|
||||
$self->session->response->setRedirect($url,$self->redirectType);
|
||||
return undef;
|
||||
}
|
||||
return $i18n->get('self_referential');
|
||||
|
|
|
|||
|
|
@ -326,46 +326,31 @@ override getEditForm => sub {
|
|||
return $f;
|
||||
};
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getAllButtons ( )
|
||||
|
||||
Get a list of all the buttons in this MCE
|
||||
|
||||
=cut
|
||||
|
||||
# Get a list of all the buttons in this MCE
|
||||
sub getAllButtons {
|
||||
my ( $self ) = @_;
|
||||
my @toolbarRows = map{[split "\n", $self->get("toolbarRow$_")]} (1..3);
|
||||
my @toolbarRows = map{[split "\n", $self->getValue("toolbarRow$_")]} (1..3);
|
||||
my @toolbarButtons = map{ @{$_} } @toolbarRows;
|
||||
return @toolbarButtons;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getConfig ( )
|
||||
|
||||
Get a hashref of configuration to create this MCE. You must run the code
|
||||
from getLoadPlugins before you can successfully initialize an MCE. You
|
||||
must also specify the "elements" key so TinyMCE knows what textarea to
|
||||
replace.
|
||||
|
||||
=cut
|
||||
|
||||
# Get a hashref of configuration to create this MCE. You must run the code
|
||||
# from getLoadPlugins before you can successfully initialize an MCE. You
|
||||
# must also specify the "elements" key so TinyMCE knows what textarea to
|
||||
# replace.
|
||||
sub getConfig {
|
||||
my ($self) = @_;
|
||||
my $i18n = WebGUI::International->new($self->session, 'Asset_RichEdit');
|
||||
my @plugins;
|
||||
push @plugins, "safari";
|
||||
push @plugins, "paste";
|
||||
push @plugins, "contextmenu"
|
||||
if $self->enableContextMenu;
|
||||
if $self->getValue("enableContextMenu");
|
||||
push @plugins, "inlinepopups"
|
||||
if $self->inlinePopups;
|
||||
if $self->getValue("inlinePopups");
|
||||
push @plugins, "media"
|
||||
if $self->allowMedia;
|
||||
if $self->getValue( 'allowMedia' );
|
||||
|
||||
my @toolbarRows = map{[split "\n", $self->get("toolbarRow$_")]} (1..3);
|
||||
my @toolbarRows = map{[split "\n", $self->getValue("toolbarRow$_")]} (1..3);
|
||||
my @toolbarButtons = map{ @{$_} } @toolbarRows;
|
||||
my %config = (
|
||||
mode => 'exact',
|
||||
|
|
@ -379,18 +364,17 @@ sub getConfig {
|
|||
( map { "theme_advanced_buttons" . ( $_ + 1 ) => ( join ',', @{ $toolbarRows[$_] } ) } ( 0 .. $#toolbarRows ) ),
|
||||
|
||||
ask => JSON::false(),
|
||||
preformatted => $self->preformatted ? JSON::true() : JSON::false(),
|
||||
force_br_newlines => $self->useBr ? JSON::true() : JSON::false(),
|
||||
force_p_newlines => $self->useBr ? JSON::false() : JSON::true(),
|
||||
$self->useBr ? ( forced_root_block => JSON::false() ) : (),
|
||||
remove_linebreaks => $self->removeLineBreaks ? JSON::true() : JSON::false(),
|
||||
nowrap => $self->nowrap ? JSON::true() : JSON::false(),
|
||||
directionality => $self->directionality,
|
||||
theme_advanced_toolbar_location => $self->toolbarLocation,
|
||||
preformatted => $self->getValue("preformatted") ? JSON::true() : JSON::false(),
|
||||
force_br_newlines => $self->getValue("useBr") ? JSON::true() : JSON::false(),
|
||||
force_p_newlines => $self->getValue("useBr") ? JSON::false() : JSON::true(),
|
||||
$self->getValue("useBr") ? ( forced_root_block => JSON::false() ) : (),
|
||||
remove_linebreaks => $self->getValue("removeLineBreaks") ? JSON::true() : JSON::false(),
|
||||
nowrap => $self->getValue("nowrap") ? JSON::true() : JSON::false(),
|
||||
directionality => $self->getValue("directionality"),
|
||||
theme_advanced_toolbar_location => $self->getValue("toolbarLocation"),
|
||||
theme_advanced_statusbar_location => "bottom",
|
||||
valid_elements => $self->validElements,
|
||||
valid_elements => $self->getValue("validElements"),
|
||||
wg_userIsVisitor => $self->session->user->isVisitor ? JSON::true() : JSON::false(),
|
||||
paste_postprocess => 'tinyMCE_WebGUI_paste_postprocess',
|
||||
);
|
||||
foreach my $button (@toolbarButtons) {
|
||||
if ( $button eq "spellchecker" && $self->session->config->get('availableDictionaries') ) {
|
||||
|
|
@ -441,10 +425,10 @@ sub getConfig {
|
|||
push @plugins, "-wgmacro";
|
||||
}
|
||||
if ( $button eq "code" ) {
|
||||
$config{theme_advanced_source_editor_width} = $self->sourceEditorWidth
|
||||
if ( $self->sourceEditorWidth > 0 );
|
||||
$config{theme_advanced_source_editor_height} = $self->sourceEditorHeight
|
||||
if ( $self->sourceEditorHeight > 0 );
|
||||
$config{theme_advanced_source_editor_width} = $self->getValue("sourceEditorWidth")
|
||||
if ( $self->getValue("sourceEditorWidth") > 0 );
|
||||
$config{theme_advanced_source_editor_height} = $self->getValue("sourceEditorHeight")
|
||||
if ( $self->getValue("sourceEditorHeight") > 0 );
|
||||
}
|
||||
} ## end foreach my $button (@toolbarButtons)
|
||||
my $language = $i18n->getLanguage( '', "languageAbbreviation" );
|
||||
|
|
@ -452,10 +436,10 @@ sub getConfig {
|
|||
$language = $i18n->getLanguage( "English", "languageAbbreviation" );
|
||||
}
|
||||
$config{language} = $language;
|
||||
$config{content_css} = $self->cssFile
|
||||
$config{content_css} = $self->getValue("cssFile")
|
||||
|| $self->session->url->extras('tinymce-webgui/defaultcontent.css');
|
||||
$config{width} = $self->editorWidth if ( $self->editorWidth > 0 );
|
||||
$config{height} = $self->editorHeight if ( $self->editorHeight > 0 );
|
||||
$config{width} = $self->getValue("editorWidth") if ( $self->getValue("editorWidth") > 0 );
|
||||
$config{height} = $self->getValue("editorHeight") if ( $self->getValue("editorHeight") > 0 );
|
||||
$config{plugins} = join( ",", @plugins );
|
||||
|
||||
return \%config;
|
||||
|
|
@ -485,15 +469,8 @@ my $sql = "select asset.assetId, assetData.revisionDate from RichEdit left join
|
|||
return \%richEditors;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getLoadPlugins ( )
|
||||
|
||||
Get the JS code to load the plugins for this MCE. Needs to be called once
|
||||
on the page this MCE will be on
|
||||
|
||||
=cut
|
||||
|
||||
# Get the JS code to load the plugins for this MCE. Needs to be called once
|
||||
# on the page this MCE will be on
|
||||
sub getLoadPlugins {
|
||||
my ( $self ) = @_;
|
||||
my %loadPlugins;
|
||||
|
|
@ -536,16 +513,131 @@ sub getRichEditor {
|
|||
my $self = shift;
|
||||
return '' if ($self->disableRichEditor);
|
||||
my $nameId = shift;
|
||||
<<<<<<< HEAD
|
||||
my @plugins;
|
||||
my %loadPlugins;
|
||||
push @plugins, "safari";
|
||||
push @plugins, "contextmenu"
|
||||
if $self->enableContextMenu;
|
||||
push @plugins, "inlinepopups"
|
||||
if $self->inlinePopups;
|
||||
push @plugins, "media"
|
||||
if $self->allowMedia;
|
||||
|
||||
my @toolbarRows = map{[split "\n", $self->get("toolbarRow$_")]} (1..3);
|
||||
my @toolbarButtons = map{ @{$_} } @toolbarRows;
|
||||
my $i18n = WebGUI::International->new($self->session, 'Asset_RichEdit');
|
||||
my $ask = $self->askAboutRichEdit;
|
||||
my %config = (
|
||||
mode => $ask ? "none" : "exact",
|
||||
elements => $nameId,
|
||||
theme => "advanced",
|
||||
relative_urls => JSON::false(),
|
||||
remove_script_host => JSON::true(),
|
||||
auto_reset_designmode => JSON::true(),
|
||||
cleanup_callback => "tinyMCE_WebGUI_Cleanup",
|
||||
urlconverter_callback => "tinyMCE_WebGUI_URLConvertor",
|
||||
theme_advanced_resizing => JSON::true(),
|
||||
(map { "theme_advanced_buttons".($_+1) => (join ',', @{$toolbarRows[$_]}) }
|
||||
(0..$#toolbarRows)),
|
||||
#ask => $self->getValue("askAboutRichEdit") ? JSON::true() : JSON::false(),
|
||||
ask => JSON::false(),
|
||||
preformatted => $self->preformatted ? JSON::true() : JSON::false(),
|
||||
force_br_newlines => $self->useBr ? JSON::true() : JSON::false(),
|
||||
force_p_newlines => $self->useBr ? JSON::false() : JSON::true(),
|
||||
$self->useBr ? ( forced_root_block => JSON::false() ) : (),
|
||||
remove_linebreaks => $self->removeLineBreaks ? JSON::true() : JSON::false(),
|
||||
nowrap => $self->nowrap ? JSON::true() : JSON::false(),
|
||||
directionality => $self->directionality,
|
||||
theme_advanced_toolbar_location => $self->toolbarLocation,
|
||||
theme_advanced_statusbar_location => "bottom",
|
||||
valid_elements => $self->validElements,
|
||||
wg_userIsVisitor => $self->session->user->isVisitor ? JSON::true() : JSON::false(),
|
||||
);
|
||||
# if ($ask) {
|
||||
# $config{oninit} = 'turnOffTinyMCE_'.$nameId;
|
||||
# }
|
||||
$self->richedit_headTags;
|
||||
foreach my $button (@toolbarButtons) {
|
||||
if ($button eq "spellchecker" && $self->session->config->get('availableDictionaries')) {
|
||||
push(@plugins,"-wgspellchecker");
|
||||
$loadPlugins{wgspellchecker} = $self->session->url->extras("tinymce-webgui/plugins/wgspellchecker/editor_plugin.js");
|
||||
$config{spellchecker_rpc_url} = $self->session->url->gateway('', "op=spellCheck");
|
||||
$config{spellchecker_languages} =
|
||||
join(',', map { ($_->{default} ? '+' : '').$_->{name}.'='.$_->{id} } @{$self->session->config->get('availableDictionaries')});
|
||||
}
|
||||
push(@plugins,"table") if ($button eq "tablecontrols");
|
||||
push(@plugins,"save") if ($button eq "save");
|
||||
push(@plugins,"advhr") if ($button eq "advhr");
|
||||
push(@plugins,"fullscreen") if ($button eq "fullscreen");
|
||||
if ($button eq "advimage") {
|
||||
push(@plugins,"advimage");
|
||||
$config{external_link_list_url} = "";
|
||||
}
|
||||
if ($button eq "advlink") {
|
||||
$config{external_image_list_url} = "";
|
||||
$config{file_browser_callback} = "mcFileManager.filebrowserCallBack";
|
||||
push(@plugins,"advlink");
|
||||
}
|
||||
push(@plugins,"emotions") if ($button eq "emotions");
|
||||
push(@plugins,"iespell") if ($button eq "iespell");
|
||||
$config{gecko_spellcheck} = 'true' if ($button eq "iespell");
|
||||
if ($button eq "paste" || $button eq "pastetext" || $button eq "pasteword") {
|
||||
push(@plugins,"paste");
|
||||
}
|
||||
if ($button eq "insertdate" || $button eq "inserttime" || $button eq "insertdatetime") {
|
||||
$config{plugin_insertdate_dateFormat} = "%Y-%m-%d";
|
||||
$config{plugin_insertdate_timeFormat} = "%H:%M:%S";
|
||||
push(@plugins,"insertdatetime");
|
||||
}
|
||||
push(@plugins,"preview") if ($button eq "preview");
|
||||
if ($button eq "media") {
|
||||
push(@plugins,"media");
|
||||
}
|
||||
push(@plugins,"searchreplace") if ($button eq "search" || $button eq "replace" || $button eq "searchreplace");
|
||||
push(@plugins,"print") if ($button eq "print");
|
||||
if ($button eq "wginsertimage") {
|
||||
push @plugins, "-wginsertimage";
|
||||
$loadPlugins{wginsertimage} = $self->session->url->extras("tinymce-webgui/plugins/wginsertimage/editor_plugin.js");
|
||||
}
|
||||
if ($button eq "wgpagetree") {
|
||||
push @plugins, "-wgpagetree";
|
||||
$loadPlugins{wgpagetree} = $self->session->url->extras("tinymce-webgui/plugins/wgpagetree/editor_plugin.js");
|
||||
}
|
||||
if ($button eq "wgmacro") {
|
||||
push @plugins, "-wgmacro";
|
||||
$loadPlugins{wgmacro} = $self->session->url->extras("tinymce-webgui/plugins/wgmacro/editor_plugin.js");
|
||||
}
|
||||
if ($button eq "code") {
|
||||
$config{theme_advanced_source_editor_width} = $self->sourceEditorWidth if ($self->sourceEditorWidth > 0);
|
||||
$config{theme_advanced_source_editor_height} = $self->sourceEditorHeight if ($self->sourceEditorHeight > 0);
|
||||
}
|
||||
}
|
||||
my $language = $i18n->getLanguage('' ,"languageAbbreviation");
|
||||
unless ($language) {
|
||||
$language = $i18n->getLanguage("English","languageAbbreviation");
|
||||
}
|
||||
$config{language} = $language;
|
||||
$config{content_css} = $self->cssFile || $self->session->url->extras('tinymce-webgui/defaultcontent.css');
|
||||
$config{width} = $self->editorWidth || "100%";
|
||||
$config{height} = $self->editorHeight || "100%";
|
||||
$config{plugins} = join(",",@plugins);
|
||||
|
||||
=======
|
||||
my $i18n = WebGUI::International->new($self->session, 'Asset_RichEdit');
|
||||
my $ask = $self->getValue("askAboutRichEdit");
|
||||
# if ($ask) {
|
||||
# $config{oninit} = 'turnOffTinyMCE_'.$nameId;
|
||||
# }
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/yahoo/yahoo-min.js'),{type=>"text/javascript"});
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/event/event-min.js'),{type=>"text/javascript"});
|
||||
$self->session->style->setScript($self->session->url->extras('tinymce/jscripts/tiny_mce/tiny_mce_src.js'),{type=>"text/javascript"});
|
||||
$self->session->style->setScript($self->session->url->extras("tinymce-webgui/callbacks.js"),{type=>"text/javascript"});
|
||||
>>>>>>> fix carousel editor panel
|
||||
my $out = '';
|
||||
if ($ask) {
|
||||
$out = q|<a style="display: block;" href="javascript:toggleEditor('|.$nameId.q|')">|.$i18n->get('Toggle editor').q|</a>|;
|
||||
}
|
||||
$self->richedit_headTags;
|
||||
$out .= qq|<script type="text/javascript">\n|;
|
||||
if ($ask) {
|
||||
$out .= <<"EOHTML1";
|
||||
|
|
|
|||
|
|
@ -1261,8 +1261,8 @@ sub www_view {
|
|||
$shortcut->purgeCache();
|
||||
|
||||
if ($shortcut->isa('WebGUI::Asset::Wobject')) {
|
||||
$self->session->http->setLastModified($self->getContentLastModified);
|
||||
$self->session->http->sendHeader;
|
||||
$self->session->response->setLastModified($self->getContentLastModified);
|
||||
$self->session->response->sendHeader;
|
||||
##Tell processStyle not to set the h
|
||||
my $style = $shortcut->processStyle($shortcut->getSeparator, { noHeadTags => 1 });
|
||||
my ($head, $foot) = split($shortcut->getSeparator,$style);
|
||||
|
|
|
|||
|
|
@ -649,8 +649,8 @@ sub www_view {
|
|||
my $self = shift;
|
||||
my $check = $self->checkView;
|
||||
return $check if (defined $check);
|
||||
$self->session->http->setLastModified($self->getContentLastModified);
|
||||
$self->session->http->sendHeader;
|
||||
$self->session->response->setLastModified($self->getContentLastModified);
|
||||
$self->session->response->sendHeader;
|
||||
$self->prepareView;
|
||||
my $style = $self->processStyle($self->getSeparator);
|
||||
my ($head, $foot) = split($self->getSeparator,$style);
|
||||
|
|
|
|||
|
|
@ -584,8 +584,8 @@ sub www_manage {
|
|||
my $self = shift;
|
||||
my $check = $self->checkView;
|
||||
return $check if (defined $check);
|
||||
$self->session->http->setLastModified($self->getContentLastModified);
|
||||
$self->session->http->sendHeader;
|
||||
$self->session->response->setLastModified($self->getContentLastModified);
|
||||
$self->session->response->sendHeader;
|
||||
$self->prepareView($self->manageTemplate);
|
||||
my $style = $self->processStyle($self->getSeparator);
|
||||
my ($head, $foot) = split($self->getSeparator,$style);
|
||||
|
|
|
|||
|
|
@ -1904,7 +1904,7 @@ Extend the base method to handle caching.
|
|||
|
||||
override www_view => sub {
|
||||
my $self = shift;
|
||||
$self->session->http->setCacheControl($self->cacheTimeout);
|
||||
$self->session->response->setCacheControl($self->cacheTimeout);
|
||||
super();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ sub www_view {
|
|||
return $self->session->privilege->insufficient() unless $self->canView;
|
||||
my $mimeType=$self->mimeType;
|
||||
$self->session->response->content_type($mimeType || 'text/html');
|
||||
$self->session->http->setCacheControl($self->cacheTimeout);
|
||||
$self->session->response->setCacheControl($self->cacheTimeout);
|
||||
my $output = $self->view(1);
|
||||
if (!defined $output) {
|
||||
$output = 'empty';
|
||||
|
|
|
|||
|
|
@ -983,7 +983,7 @@ the Story Archive that contains them.
|
|||
sub www_view {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->noAccess unless $self->canView;
|
||||
$self->session->http->sendHeader;
|
||||
$self->session->response->sendHeader;
|
||||
$self->prepareView;
|
||||
return $self->getArchive->processStyle($self->view);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -985,7 +985,7 @@ the user back to the site.
|
|||
|
||||
sub www_goBackToPage {
|
||||
my $self = shift;
|
||||
$self->session->http->setRedirect($self->session->form->get("returnUrl")) if ($self->session->form->get("returnUrl"));
|
||||
$self->session->response->setRedirect($self->session->form->get("returnUrl")) if ($self->session->form->get("returnUrl"));
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -548,7 +548,7 @@ sub www_purgeRevision {
|
|||
$asset->purgeRevision;
|
||||
if ($session->form->process("proceed") eq "manageRevisionsInTag") {
|
||||
my $working = (defined $self) ? $self : $parent;
|
||||
$session->http->setRedirect($working->getUrl("op=manageRevisionsInTag"));
|
||||
$session->response->setRedirect($working->getUrl("op=manageRevisionsInTag"));
|
||||
return undef;
|
||||
}
|
||||
unless (defined $self) {
|
||||
|
|
@ -601,9 +601,9 @@ sub www_view {
|
|||
return $self->session->privilege->noAccess unless $self->canView;
|
||||
$self->update({ views => $self->views+1 });
|
||||
# TODO: This should probably exist, as the CS has one.
|
||||
# $self->session->http->setCacheControl($self->getWiki->get('visitorCacheTimeout'))
|
||||
# $self->session->response->setCacheControl($self->getWiki->get('visitorCacheTimeout'))
|
||||
# if ($self->session->user->isVisitor);
|
||||
$self->session->http->sendHeader;
|
||||
$self->session->response->sendHeader;
|
||||
$self->prepareView;
|
||||
return $self->getWiki->processStyle($self->view);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -505,8 +505,8 @@ sub www_view {
|
|||
my $self = shift;
|
||||
my $check = $self->checkView;
|
||||
return $check if (defined $check);
|
||||
$self->session->http->setLastModified($self->getContentLastModified);
|
||||
$self->session->http->sendHeader;
|
||||
$self->session->response->setLastModified($self->getContentLastModified);
|
||||
$self->session->response->sendHeader;
|
||||
##Have to dupe this code here because Wobject does not call SUPER.
|
||||
$self->prepareView;
|
||||
my $style = $self->processStyle($self->getSeparator, { noHeadTags => 1 });
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ See WebGUI::Asset::Wobject::www_view() for details.
|
|||
|
||||
override www_view => sub {
|
||||
my $self = shift;
|
||||
$self->session->http->setCacheControl($self->cacheTimeout);
|
||||
$self->session->response->setCacheControl($self->cacheTimeout);
|
||||
super();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1885,7 +1885,7 @@ Extend the base method to handle the visitor cache timeout.
|
|||
sub www_view {
|
||||
my $self = shift;
|
||||
my $disableCache = ($self->session->form->process("sortBy") ne "");
|
||||
$self->session->http->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor && !$disableCache);
|
||||
$self->session->response->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor && !$disableCache);
|
||||
return $self->next::method(@_);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -611,10 +611,10 @@ sub www_view {
|
|||
if ($self->state eq "published") { # no privileges, make em log in
|
||||
return $self->session->privilege->noAccess();
|
||||
} elsif ($self->session->isAdminOn && $self->state =~ /^trash/) { # show em trash
|
||||
$self->session->http->setRedirect($self->getUrl("func=manageTrash"));
|
||||
$self->session->response->setRedirect($self->getUrl("func=manageTrash"));
|
||||
return undef;
|
||||
} elsif ($self->session->isAdminOn && $self->state =~ /^clipboard/) { # show em clipboard
|
||||
$self->session->http->setRedirect($self->getUrl("func=manageClipboard"));
|
||||
$self->session->response->setRedirect($self->getUrl("func=manageClipboard"));
|
||||
return undef;
|
||||
} else { # tell em it doesn't exist anymore
|
||||
$self->session->response->status(410);
|
||||
|
|
|
|||
|
|
@ -1341,7 +1341,7 @@ sub viewForm {
|
|||
}
|
||||
$var = $passedVars || $self->getRecordTemplateVars($var, $entry);
|
||||
if ($self->hasCaptcha) {
|
||||
$self->session->http->setCacheControl('none');
|
||||
$self->session->response->setCacheControl('none');
|
||||
}
|
||||
return $self->processTemplate($var, undef, $self->{_viewFormTemplate});
|
||||
}
|
||||
|
|
@ -1891,7 +1891,7 @@ sub www_exportTab {
|
|||
|
||||
$session->response->header( 'Content-Disposition' => qq{attachment; filename="}.$self->url.'.tab"');
|
||||
$session->response->content_type('text/plain');
|
||||
$session->http->sendHeader;
|
||||
$session->response->sendHeader;
|
||||
$session->output->print($tsv->string, 1);
|
||||
|
||||
my $entryIter = $self->entryClass->iterateAll($self);
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ See WebGUI::Asset::Wobject::www_view() for details.
|
|||
|
||||
override www_view => sub {
|
||||
my $self = shift;
|
||||
$self->session->http->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor);
|
||||
$self->session->response->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor);
|
||||
super();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -837,8 +837,8 @@ sub sendChunkedContent {
|
|||
|
||||
my $session = $self->session;
|
||||
|
||||
$session->http->setLastModified($self->getContentLastModified);
|
||||
$session->http->sendHeader;
|
||||
$session->response->setLastModified($self->getContentLastModified);
|
||||
$session->response->sendHeader;
|
||||
my $style = $self->processStyle($self->getSeparator);
|
||||
my ($head, $foot) = split($self->getSeparator,$style);
|
||||
$session->output->print($head, 1);
|
||||
|
|
|
|||
|
|
@ -497,7 +497,7 @@ sub www_view {
|
|||
if ($self->session->response->content_type ne "text/html") {
|
||||
return $output;
|
||||
} else {
|
||||
$self->session->http->sendHeader;
|
||||
$self->session->response->sendHeader;
|
||||
my $style = $self->processStyle($self->getSeparator, { noHeadTags => 1 });
|
||||
my ($head, $foot) = split($self->getSeparator,$style);
|
||||
$self->session->output->print($head);
|
||||
|
|
|
|||
|
|
@ -426,8 +426,8 @@ override www_view => sub {
|
|||
my $ad = $adSpace->displayImpression if (defined $adSpace);
|
||||
$out =~ s/\Q$code/$ad/ges;
|
||||
}
|
||||
$session->http->setLastModified($self->getContentLastModified);
|
||||
$session->http->sendHeader;
|
||||
$session->response->setLastModified($self->getContentLastModified);
|
||||
$session->response->sendHeader;
|
||||
$session->output->print($out, 1);
|
||||
return "chunked";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1080,7 +1080,7 @@ sub www_exportAttributes {
|
|||
|
||||
$session->response->header( 'Content-Disposition' => qq{attachment; filename="export_matrix_attributes.csv"});
|
||||
$session->response->content_type('application/octet-stream');
|
||||
$self->session->http->sendHeader;
|
||||
$self->session->response->sendHeader;
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ See WebGUI::Asset::Wobject::www_view() for details.
|
|||
|
||||
override www_view => sub {
|
||||
my $self = shift;
|
||||
$self->session->http->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor);
|
||||
$self->session->response->setCacheControl($self->visitorCacheTimeout) if ($self->session->user->isVisitor);
|
||||
super();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ See WebGUI::Asset::Wobject::www_view() for details.
|
|||
|
||||
override www_view => sub {
|
||||
my $self = shift;
|
||||
$self->session->http->setCacheControl($self->cacheTimeout);
|
||||
$self->session->response->setCacheControl($self->cacheTimeout);
|
||||
super();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -504,7 +504,7 @@ Do a redirect to the form parameter returnUrl if it exists.
|
|||
|
||||
sub www_goBackToPage {
|
||||
my $self = shift;
|
||||
$self->session->http->setRedirect($self->session->form->process("returnUrl")) if ($self->session->form->process("returnUrl"));
|
||||
$self->session->response->setRedirect($self->session->form->process("returnUrl")) if ($self->session->form->process("returnUrl"));
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -704,7 +704,7 @@ sub www_download {
|
|||
$self->downloadType eq 'csv' ? "application/octet-stream" : $self->downloadMimeType
|
||||
);
|
||||
|
||||
$self->session->http->sendHeader;
|
||||
$self->session->response->sendHeader;
|
||||
|
||||
|
||||
return $self->download;
|
||||
|
|
@ -722,7 +722,7 @@ See WebGUI::Asset::Wobject::www_view() for details.
|
|||
|
||||
override www_view => sub {
|
||||
my $self = shift;
|
||||
$self->session->http->setCacheControl($self->cacheTimeout);
|
||||
$self->session->response->setCacheControl($self->cacheTimeout);
|
||||
super();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ See WebGUI::Asset::Wobject::www_view() for details.
|
|||
|
||||
override www_view => sub {
|
||||
my $self = shift;
|
||||
$self->session->http->setCacheControl($self->cacheTimeout);
|
||||
$self->session->response->setCacheControl($self->cacheTimeout);
|
||||
super();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue