Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 30 additions & 35 deletions View/Elements/common_header.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,27 @@ if (! isset($isSettingMode)) {
); ?>
<?php endif; ?>

<?php echo $this->NetCommonsHtml->link('NetCommons3',
<?php echo $this->NetCommonsHtml->link(SiteSettingUtil::read('App.site_name'),
NetCommonsUrl::actionUrl('/'), array('class' => 'navbar-brand')); ?>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<?php echo $this->NetCommonsHtml->link(__d('net_commons', 'Home'),
NetCommonsUrl::actionUrl('/')); ?>
</li>
<?php if ($user = AuthComponent::user()) : ?>
<li>
<?php echo $this->NetCommonsHtml->link(__d('net_commons', 'Logout'),
NetCommonsUrl::actionUrl('/auth/logout')); ?>
<ul class="nav navbar-nav navbar-right">
<?php if (AuthComponent::user()) : ?>
<li class="visible-sm">
<?php echo $this->NetCommonsHtml->avatarLink(Current::read(), [], [], 'User.id'); ?>
</li>
<?php else: ?>
<?php if (! SiteSettingUtil::read('App.close_site') && SiteSettingUtil::read('AutoRegist.use_automatic_register', false)) : ?>
<li>
<?php echo $this->NetCommonsHtml->link(__d('auth', 'Sign up'),
NetCommonsUrl::actionUrl('/auth/auto_user_regist/request')); ?>
</li>
<?php endif; ?>
<li class="hidden-sm">
<?php echo $this->NetCommonsHtml->handleLink(Current::read(), ['avatar' => true], [], 'User'); ?>
</li>
<?php endif; ?>

<?php if (Current::hasSettingMode()) : ?>
<li>
<?php echo $this->NetCommonsHtml->link(__d('net_commons', 'Login'),
NetCommonsUrl::actionUrl('/auth/login')); ?>
<?php if (! $isSettingMode) : ?>
<?php echo $this->NetCommonsHtml->link(__d('pages', 'Setting mode on'), NetCommonsUrl::backToPageUrl(true)); ?>
<?php else: ?>
<?php echo $this->NetCommonsHtml->link(__d('pages', 'Setting mode off'), NetCommonsUrl::backToPageUrl()); ?>
<?php endif; ?>
</li>
<?php endif; ?>

Expand All @@ -82,16 +79,6 @@ if (! isset($isSettingMode)) {
</li>
<?php endif; ?>

<?php if (Current::hasSettingMode()) : ?>
<li>
<?php if (! $isSettingMode) : ?>
<?php echo $this->NetCommonsHtml->link(__d('pages', 'Setting mode on'), NetCommonsUrl::backToPageUrl(true)); ?>
<?php else: ?>
<?php echo $this->NetCommonsHtml->link(__d('pages', 'Setting mode off'), NetCommonsUrl::backToPageUrl()); ?>
<?php endif; ?>
</li>
<?php endif; ?>

<?php if (Current::hasControlPanel()) : ?>
<li>
<?php if (! Current::isControlPanel()): ?>
Expand All @@ -102,17 +89,25 @@ if (! isset($isSettingMode)) {
<?php endif; ?>
</li>
<?php endif; ?>
</ul>

<ul class="nav navbar-nav navbar-right">
<?php if (AuthComponent::user()) : ?>
<li class="visible-sm">
<?php echo $this->NetCommonsHtml->avatarLink(Current::read(), [], [], 'User.id'); ?>
<li>
<?php echo $this->NetCommonsHtml->link(__d('net_commons', 'Logout'),
NetCommonsUrl::actionUrl('/auth/logout')); ?>
</li>
<li class="hidden-sm">
<?php echo $this->NetCommonsHtml->handleLink(Current::read(), ['avatar' => true], [], 'User'); ?>
<?php else: ?>
<?php if (! SiteSettingUtil::read('App.close_site') && SiteSettingUtil::read('AutoRegist.use_automatic_register', false)) : ?>
<li>
<?php echo $this->NetCommonsHtml->link(__d('auth', 'Sign up'),
NetCommonsUrl::actionUrl('/auth/auto_user_regist/request')); ?>
</li>
<?php endif; ?>
<li>
<?php echo $this->NetCommonsHtml->link(__d('net_commons', 'Login'),
NetCommonsUrl::actionUrl('/auth/login')); ?>
</li>
<?php endif; ?>

</ul>
</div>
</div>
Expand Down