FWS-V2
view release on metacpan or search on metacpan
lib/FWS/V2/Admin.pm view on Meta::CPAN
#
if ( !$editHash{disableEditTool} && $editHash{type} ne 'page') {
$editHTML .= $self->FWSIcon(
icon => "properties_16.png",
onClick => $self->dialogWindow( queryString => "p=fws_dataEdit&guid=" . $editHash{guid} . "&parentId=" . $editHash{parent} ),
alt => "Edit",
width => "16",
);
}
#
# ON/OFF cotnrol
#
if ( !$editHash{disableActiveTool} && $editHash{guid} ne $self->homeGUID() ) { $editHTML .= $self->onOffLight( $editHash{active}, $editHash{guid} ) }
#
# close the edit bar container
#
if ( !$editHash{editBoxJustButtons} ) { $editHTML .= '</div>' }
$editHTML .= $editHash{editBoxContent};
$editHTML .= $editHash{editBox};
#
# close the delete ajax container
#
if ( !$editHash{editBoxJustButtons} ) { $editHTML .= '</div>' }
}
}
#
# edit mode is not on, just show the content and call this good
#
else { $editHTML .= $editHash{editBoxContent} . $editHash{editBox} }
return $editHTML;
}
=head2 FWSMenu
Return the FWS top menu bar.
=cut
sub FWSMenu {
my ( $self, %paramHash ) = @_;
#
# because we have a menu, it might need tiny mce
#
$self->{tinyMCEEnable} = 1;
my $linkSpacer = " · ";
my $FWSMenu;
#
# create a correct label for fws/devel link to know what we have access too
#
if ( $self->userValue( 'isAdmin' ) || $self->userValue( 'showDeveloper' ) ) {
$FWSMenu .= $self->popupWindow( queryString => "p=fws_systemInfo", linkHTML => "System" );
$FWSMenu .= $linkSpacer;
}
#
# get the FWSMenu taged elements and add them to the list
#
my @elementArray = $self->elementArray( tags => 'FWSMenu' );
@elementArray = $self->sortDataByNumber( 'ord', @elementArray );
for my $i (0 .. $#elementArray) {
#
# blank out the adminGroup if we have access so we can pass by the security check
#
map { if ( $self->userValue( $_ ) eq 1 ) { $elementArray[$i]{adminGroup} = '' } } split( /,/, $elementArray[$i]{adminGroup} );
#
# if we have access or we are super user show it
#
if ( !$elementArray[$i]{adminGroup} || $self->userValue( 'isAdmin' ) ) {
#
# convert to our friendly name format
#
( my $fwsLink = $elementArray[$i]{type} ) =~ s/^FWS/fws_/sg;
#
# if this is not a friendly type version menu item then use the guid
#
$fwsLink ||= 'fws_' . $elementArray[$i]{guid};
my $queryString = "FWS_pageId=" . $paramHash{pageId} . "&p=" . $fwsLink . "&FWS_showElementOnly=";
if ( $elementArray[$i]{rootElement} ) { $FWSMenu .= $self->popupWindow( queryString => $queryString . "0", linkHTML => $elementArray[$i]{title} ) }
else { $FWSMenu .= $self->dialogWindow( queryString => $queryString . "1", linkHTML => $elementArray[$i]{title} ) }
$FWSMenu .= $linkSpacer;
}
}
if ( $self->formValue( "p" ) =~ /^fws_/ ) {
$FWSMenu .= $self->_selfWindow( "", "View Site" );
$FWSMenu .= $linkSpacer;
}
#
# ALWAYS ON
#
if ( $self->userValue( 'isAdmin' ) || $self->userValue( 'showDesign' ) || $self->userValue( 'showContent' ) || $self->userValue( 'showDeveloper' ) ) {
$FWSMenu .= $self->_editModeLink( '', $linkSpacer );
}
$FWSMenu .= $self->_logOutLink();
if ( $self->userValue( 'isAdmin' ) || $self->userValue( 'showDesign' ) || $self->userValue( 'showContent' ) || $self->userValue( 'showDeveloper' ) ) {
#
# just in case we havn't installed FWS core yet, lets make sure the image is there before we
# try to display it.
#
if ( -e $self->{filePath} . '/fws/icons/add_reorder_16.png' ) {
$FWSMenu .= $linkSpacer;
$FWSMenu .= $self->FWSIcon(
icon => 'add_reorder_16.png',
onClick => $self->dialogWindow( queryString => 'p=fws_dataOrdering&guid=' . $paramHash{pageId} . '&pageOnly=1' ),
alt => 'Add And Ordering',
width => '16',
);
}
}
$FWSMenu .= $linkSpacer;
return $FWSMenu;
}
=head2 panel
FWS panel HTML: Pass title, content and panelStyle keys.
=cut
sub panel {
my ( $self, %paramHash ) = @_;
my $panel;
if ( $paramHash{inline} ) {
$panel .= "<div style=\"width:95%;font-size:12px;margin-top:10px;padding-bottom:10px;margin-bottom:10px;border: 1px solid #d3d3d3; padding:10px;background: #ffffff; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; font...
$panel .= "<div style=\"padding:5px 15px 15px 15px;font-weight:800;font-size:14px;color:#2B6FB6;\" class=\"FWSPanelTitle\">" . $paramHash{title} . "</div>";
$panel .= "<div steyl=\" padding:5px 15px 15px 15px;font-size:12px;\" class=\"FWSPanelContent\">" . $paramHash{content} . "</div>";
$panel .= "</div>";
}
else {
lib/FWS/V2/Admin.pm view on Meta::CPAN
# Page View Tool
#
$treeHTML .= "<div class=\"FWSActionButton\">";
if ( $paramHash{viewTool} ) {
my $editURL = $self->{scriptName} . $self->{queryHead};
$editURL .= "&editMode=1";
$editURL .= "&p=" . $paramHash{id};
$treeHTML .= "<img alt=\"Open Page\" onclick=\"location.href='" . $editURL . "';\" title=\"" . $paramHash{id} . "\" style=\"cursor:pointer;display:inline;border:0pt none;\" src=\"" . $self->{fileFWSPath} . "/icons/go_16.png\"/>";
}
else { $treeHTML .= " " };
$treeHTML .= "</div>";
#
# The Delete Tool
#
$treeHTML .= "<div class=\"FWSActionButton\">";
if ( $paramHash{deleteTool} ) {
$treeHTML .= $self->FWSIcon(
icon => "delete_16.png",
onClick => "if (confirm('Are you sure you want to delete this item and all of its related sub items? (Non-reversable)'" .
")){FWSAjax('" . $self->{scriptName} . "','" . $self->{queryHead} .
"p=fws_dataEdit&pageAction=deleteElement&parent=" . $paramHash{parentId} .
"&guid=" . $paramHash{id} . "');" .
"\$('#block_" . $paramHash{id} . "').hide('slow');}return false;",
alt => "Delete",
width => "16",
);
}
elsif ( $paramHash{emailDeleteTool} ) {
$treeHTML .= $self->FWSIcon(
icon =>"delete_16.png",
onClick => "if (confirm('Are you sure you want to delete this message? (Non-reversable)'" .
")){FWSAjax('" . $self->{scriptName} . "','" . $self->{queryHead} .
"&pageAction=deleteMessage" .
"&guid=" . $paramHash{id} . "');" .
"\$('#block_" . $paramHash{id} . "').hide('slow');}return false;",
alt => "Delete",
width => "16",
);
}
else { $treeHTML .= " " };
$treeHTML .= "</div>";
#
# 3dit tool
#
$treeHTML .= "<div class=\"FWSActionButton\">";
if ( $paramHash{emailEditTool} ) {
$treeHTML .= $self->FWSIcon(
icon => "properties_16.png",
onClick => $self->dialogWindow( queryString => "p=fws_messageEdit&guid=" . $paramHash{id} ),
alt => "Edit",
width => "16",
);
}
if ( $paramHash{pageTool} ) {
$treeHTML .= $self->FWSIcon(
icon => "properties_16.png",
onClick => $self->popupWindow( queryString => "p=fws_pageEdit&FWS_pageId=" . $paramHash{guid} . "&FWS_showElementOnly=0" ),
alt => "Edit",
width => "16",
id => "edit_".$paramHash{id},
);
}
else {
$treeHTML .= " "
}
$treeHTML .= "</div>";
#
# on off tool
#
$treeHTML .= "<div class=\"FWSActionButton\">";
if ( $paramHash{activeTool} ) {
$treeHTML .= $self->onOffLight( $paramHash{active}, $paramHash{guid} );
}
else {
$treeHTML .= " ";
}
$treeHTML .= "</div>";
#
# template Tool
#
if ( $paramHash{templateTool} ) {
if ( !$self->formValue( "templateList" ) ) {
$self->formValue( "templateList", "0|Default Template|" );
#
# get the array of all the templates availalbe
#
my @templateArray = $self->templateArray();
#
# loop through them and create a pipe delimited list
#
for my $i (0 .. $#templateArray) {
$self->formValue( "templateList", $self->formValue( "templateList" ) . $templateArray[$i]{guid} . "|" . $templateArray[$i]{title} . "|" );
}
}
$treeHTML .= "<div style=\"float:right;\">" . $self->adminField(
fieldType => 'dropDown',
fieldValue => $paramHash{layout},
style => 'width:200px;',
fieldName => 'layout',
fieldOptions => $self->formValue( 'templateList' ),
updateType => 'AJAXUpdate',
ajaxUpdateTable => 'guid_xref',
ajaxUpdateParentId => $paramHash{parentId},
ajaxUpdateGUID => $paramHash{guid}
);
$treeHTML .= "</div>";
$treeHTML .= "<div style=\"float:right;\">";
if ( !$paramHash{id} ) {
( run in 0.633 second using v1.01-cache-2.11-cpan-364913b4093 )