Revision 607 (by ahitrov, 2016/10/28 20:56:45) Order by section switch on-off.
Administrative panel content maximizing.

<& "/contenido/components/title.msn", %ARGS &>
<table width="100%" cellspacing="10" cellpadding="0" border="0" style="background-color:#445D82;" class="tatop">
<tr>
<td><b>Редакторский интерфейс\
% if( $style ne 'index' ) {
:&nbsp; <a href="/contenido/">На главную</a>
% }
</b></td>
<td align="right"><b><a href="/" style="text-decoration:none;"><% $pn_name %><span style="background-color:#efefef;color:#000000;margin:2px;"> <% uc($pn_domen) %> </span></a></b></td>
</tr>
<tr>
<td>
%	my @TABS = ();
%	my @plugins = ($state->project, split(/\s+/, $state->plugins));
%	my %plugins = map { lc($_) => 1 } @plugins;
%	for my $tab_id ( sort { $a cmp $b } keys %{ $toopi } ) {
%		my ($b1, $b2) = $tab_id eq $profile ? ('<b>', '</b>') : ('', '');
%		if ($r->uri() =~ /keywords\.html$/ || ($r->uri =~ /^\/contenido\/(\w+)\//i && exists $plugins{lc($1)} ) ) {
%			($b1, $b2) = ('', '');
%		}
%		next if $tab_id eq 'admin' && !$user->check_group(1);
%		push (@TABS, $b1.'<a href="/contenido/?set_context=profile-'.$tab_id.'">'.$toopi->{$tab_id}->{name}.'</a>'.$b2);
%	}
<% join('&nbsp;|&nbsp', @TABS) %>\
%	for my $plugin ($state->project, split(/\s+/, $state->plugins)) {
%		my $l_plugin = lc($plugin);
%		next if $state->{$l_plugin}->{contenido_notab};
%		my $uri = "$plugin/";
%		my $tab_name;
%		if (exists $state->{$plugin}{tab_name} && $state->{$plugin}{tab_name}) {
%			$tab_name = $state->{$plugin}{tab_name};
%		} elsif ($plugin eq $state->project) {
%			$tab_name = $state->project_name;
%		} else {
%			$tab_name = $plugin;
%		}
%		my ($b1, $b2) = $r->uri =~ /^\/contenido\/(\w+)\//i && lc($1) eq $l_plugin ? ('<b>','</b>') : ('','');
&nbsp;|&nbsp;<a href="/contenido/<% $uri %>"><% $b1.$tab_name.$b2 %></a>
%	}
</td>
<td align="right">
<b>Пользователь:</b> <% $user->name() %> (<% $user->login() %>)
</td>
</tr>
</table>

<script>
<!--
function openWin(wUri, wName, wWidth, wHeight, wScroll, wMenu) {
	var scrollBars = (wScroll!=0) ? 1 : 0;
	var menuBars = (wMenu) ? 1 : 0;
	var positionLeft = (screen.width - wWidth)/2;
	var positionTop = (screen.height - wHeight)/2;
	var myW = window.open(wUri,wName,'width='+wWidth+',height='+wHeight+',top='+positionTop+',left='+positionLeft+',location=0,menubar='+menuBars+',resizable=0,scrollbars='+scrollBars+',status=0,titlebar=0,toolbar=0,directories=0,hotkeys=0')
	myW.focus();
}
$(document).ready(function() {
    $('.width-toggler').on('click', function(ev) {
	ev.preventDefault();
	var $col_side = $('#column-side');
	var $col_content = $('#column-content');

	if ( $col_side.width() < 40 ) {
		$col_content.width('65%');
		$col_side.width('35%').children('fieldset').fadeIn(300);
		setCookie('<% $cookie_width %>', '0');
	} else {
		$col_side.children('fieldset').fadeOut(300, function(){
			$col_side.width('0');
			$col_content.width('100%');
		});
		setCookie('<% $cookie_width %>', '1');
	}
    });
});
//-->
</script>
<style>
% if ( $content_fullwidth ) {
#column-side { width:0; }
#column-side fieldset { display:none; }
#column-content { width:100%; }
% } else {
#column-side { width:35%; }
#column-content { width:65%; }
% }
</style>
<%once>

    my $cookie_width = 'content_fullwidth';

</%once>
<%args>

	$style => undef
	$title => undef

</%args>
<%init>
	my $pn = $state->project_name();
	my ($pn_name, $pn_domen) = split(/\./, $pn);

	my $toopi = $project->tabs();

	my $profile = $m->comp('/contenido/components/context.msn', name => 'profile');
	my $content_fullwidth = $m->comp('/contenido/components/cookies.msn', name => $cookie_width);

</%init>