Skip to content

Commit

Permalink
splitted start page menu in 'news' and 'opencaching'; updates #73
Browse files Browse the repository at this point in the history
  • Loading branch information
following5 committed Jul 19, 2013
1 parent 4e2d4e2 commit 2169282
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 28 deletions.
40 changes: 24 additions & 16 deletions htdocs/doc/sql/static-data/data.sql

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions htdocs/lang/de/ocstyle/lib/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,16 @@
'visible' => true,
'filename' => 'articles.php?page=htmltags',
'siteid' => 'articles/htmltags'
),
array(
'title' => t('My caches'),
'menustring' => t('My caches'),
'visible' => true,
'filename' => 'myhome.php#mycaches',
'siteid' => 'myhome'
)
)
),
array(
'title' => t('My caches'),
'menustring' => t('My caches'),
'visible' => true,
'filename' => 'myhome.php#mycaches',
'siteid' => 'myhome'
),
array(
'title' => t('Special caches'),
'menustring' => t('Special caches'),
Expand Down
1 change: 1 addition & 0 deletions htdocs/lib2/OcSmarty.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ function display($dummy1=null, $dummy2=null, $dummy3=null)
else
$menu->SetSelectItem($this->menuitem);

$this->assign('tplname', $this->name);
$this->assign('topmenu', $menu->getTopMenu());
$this->assign('submenu', $menu->getSubMenu());
$this->assign('breadcrumb', $menu->getBreadcrumb());
Expand Down
6 changes: 3 additions & 3 deletions htdocs/lib2/menu.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function CreateCacheFile()
$aMenu[$r['id']]['href'] = $r['href'];
$aMenu[$r['id']]['target'] = '';
}
$aMenu[$r['id']]['visible'] = ($r['visible'] == 1) ? true : false;
$aMenu[$r['id']]['visible'] = $r['visible'];
$aMenu[$r['id']]['sublevel'] = $this->pGetMenuSublevel($r['id']);

if ($r['parentid'] != 0)
Expand Down Expand Up @@ -168,7 +168,7 @@ function GetTopMenu()
$retval = array();
foreach ($menuitem[MNU_ROOT]['subitems'] AS $item)
{
if (($menuitem[$item]['authlevel'] != AUTH_LEVEL_ADMIN || $login->admin != 0) && $menuitem[$item]['visible'] == true)
if (($menuitem[$item]['authlevel'] != AUTH_LEVEL_ADMIN || $login->hasAdminPriv()) && ($menuitem[$item]['visible'] == 1 || ($menuitem[$item]['visible'] == 2 && !$login->logged_in())))
{
$thisitem = $menuitem[$item];
$thisitem['selected'] = isset($ids[$item]);
Expand Down Expand Up @@ -207,7 +207,7 @@ function pAppendSubMenu($menuid, $ids, &$items)
{
foreach ($menuitem[$menuid]['subitems'] AS $item)
{
if (($menuitem[$item]['authlevel'] != AUTH_LEVEL_ADMIN || $login->admin != 0) && $menuitem[$item]['visible'] == true)
if (($menuitem[$item]['authlevel'] != AUTH_LEVEL_ADMIN || $login->hasAdminPriv()) && ($menuitem[$item]['visible'] == 1 || ($menuitem[$item]['visible'] == 2 && !$login->logged_in())))
{
$thisitem = $menuitem[$item];
$thisitem['selected'] = isset($ids[$item]);
Expand Down
4 changes: 3 additions & 1 deletion htdocs/templates2/ocstyle/sys_main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@
{* <!-- Navigation Level 3 --> *}
<div class="nav3">
<ul>
<li class="title">{t}Main menu{/t}</li>
<li class="title">
{if $tplname=='start'}{* start page hack *}{t}News{/t}{else}{t}Main menu{/t}{/if}
</li>
{nocache}
{include file="sys_submenu.tpl" items="$submenu"}
{/nocache}
Expand Down
9 changes: 8 additions & 1 deletion htdocs/templates2/ocstyle/sys_submenu.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
{* OCSTYLE *}
{strip}
{foreach name=submenu from=$items item=menuitem}
<li class="group{$menuitem.sublevel}{if $menuitem.selected} group_active{/if}"><a href="{$menuitem.href}" {$menuitem.target}>{$menuitem.menustring|escape}</a></li>
{if $menuitem.href == ''}
{* separator headline *}
<li class="bgcolor1" style="line-height:1.5em">&nbsp;</li>
<li class="title">{$menuitem.menustring|escape}</li>
{else}
{* selectable menu option *}
<li class="group{$menuitem.sublevel}{if $menuitem.selected} group_active{/if}"><a href="{$menuitem.href}" {$menuitem.target}>{$menuitem.menustring|escape}</a></li>
{/if}
{/foreach}
{/strip}

0 comments on commit 2169282

Please sign in to comment.