-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a30856
commit f2e174c
Showing
19 changed files
with
517 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?php | ||
/** | ||
* MainMenu | ||
* @author Ilja Tihhanovski <[email protected]> | ||
* @copyright (c) 2015 Intellisoft OÜ | ||
* | ||
*/ | ||
|
||
class SquaredMainMenu extends HtmlComponent | ||
{ | ||
public function toHtml() | ||
{ | ||
$p = app()->dbo("menupart"); | ||
$p->orderBy("id"); | ||
$parts = array(); | ||
if($p->find()) | ||
while($p->fetch()) | ||
{ | ||
switch ($p->id) | ||
{ | ||
case 1: | ||
$icon = "fa-file"; | ||
break; | ||
case 2: | ||
$icon = "fa-print"; | ||
break; | ||
case 3: | ||
$icon = "fa-list-alt"; | ||
break; | ||
case 4: | ||
$icon = "fa-gear"; | ||
break; | ||
default: | ||
$icon = "fa-cube"; | ||
break; | ||
} | ||
$parts[$icon] = clone $p; | ||
} | ||
|
||
$p = app()->dbo("rmodule"); | ||
$p->orderBy("pos"); | ||
$modules = array(); | ||
if($p->find()) | ||
while($p->fetch()) | ||
$modules[] = clone $p; | ||
|
||
$registries = app()->registries(); | ||
|
||
$ret = "<aside class=\"sidebar\"><nav class=\"sidebar-nav\"><ul class=\"metismenu\" id=\"menu\">"; | ||
|
||
foreach ($modules as $m) | ||
{ | ||
$sub = ""; | ||
|
||
foreach ($parts as $icon => $mp) | ||
foreach ($registries as $reg) | ||
if($reg->module == $m->getIdValue() && $reg->menupartId == $mp->getIdValue() && $reg->typeId < 10) | ||
$sub .= "<li><a href=\"" . app()->url("?registry=" . $reg->name) . "\"><span class=\"sidebar-nav-item-icon fa $icon\" aria-hidden=\"true\"></span>" . | ||
t($reg->getCaption()) . | ||
"</a></li>\n\n"; | ||
|
||
|
||
$ret .= "<li>" . | ||
"<a href=\"#\" aria-expanded=\"false\">" . | ||
"<span class=\"sidebar-nav-item-icon fa fa-cube\" aria-hidden=\"true\"></span>" . t($m->name) . "</a>" . //fa-lg | ||
"<ul aria-expanded=\"false\">" . | ||
$sub . | ||
"</ul>" . | ||
"</li>"; | ||
} | ||
|
||
$ret .= "</ul></nav></aside>" . | ||
"<script src=\"" . app()->ui()->url("js/mainMenu.js") . "\"></script>"; | ||
|
||
|
||
return $ret; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
/** | ||
* MainMenu | ||
* @author Ilja Tihhanovski <[email protected]> | ||
* @copyright (c) 2015 Intellisoft OÜ | ||
* | ||
*/ | ||
|
||
class SquaredToolbar extends HtmlComponent | ||
{ | ||
public function toHtml() | ||
{ | ||
$ret = '<div id="dh" class="frontpageTopMenu"> | ||
<div class="frontpageCaption"> | ||
<img src="<?=app()->url("resources/p2logo.png")?>" border="0" height="24"/> | ||
<?=APP_TITLE . ($cn ? " / " . $cn : "")?> | ||
</div>' . app()->ui()->getUserMenu()->toHtml() . '</div>'; | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* MainMenu | ||
* @author Ilja Tihhanovski <[email protected]> | ||
* @copyright (c) 2015 Intellisoft OÜ | ||
* | ||
*/ | ||
|
||
class SquaredUserMenu extends HtmlComponent | ||
{ | ||
public function toHtml() | ||
{ | ||
return '<div class="squaredUserMenu"> | ||
<div> | ||
<!--a href="JavaScript:logout();"><?=t("Logout")?></a--> | ||
<i class="userMenuItem fa fa-share-alt" aria-hidden="true"></i> | ||
<i class="userMenuItem fa fa-user" aria-hidden="true"></i> | ||
<i class="userMenuItem fa fa-cog" aria-hidden="true"></i> | ||
</div> | ||
</div>'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
<?php | ||
|
||
const MAIN_MENU_CLASS = "SquaredMainMenu"; | ||
const TOOLBAR_CLASS = "SquaredToolbar"; | ||
const USERMENU_CLASS = "SquaredUserMenu"; | ||
|
||
$uiModuleDir = app()->getAbsoluteFile(UI_MODULE); | ||
require_once $uiModuleDir . "SquaredUIModule.php"; | ||
require_once $uiModuleDir . "SquaredMainMenu.php"; | ||
require_once $uiModuleDir . "classes/SquaredUIModule.php"; | ||
require_once $uiModuleDir . "classes/SquaredMainMenu.php"; | ||
require_once $uiModuleDir . "classes/SquaredToolbar.php"; | ||
require_once $uiModuleDir . "classes/SquaredUserMenu.php"; | ||
|
||
app()->_uiModule = new SquaredUIModule(); | ||
app()->_uiModule = new SquaredUIModule("Squared"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,4 @@ | ||
|
||
function togglePart(partId) | ||
{ | ||
$("#partItemsContainer" + partId).toggle(); | ||
$(this).toggleClass("partSelected"); | ||
} | ||
|
||
$(function() | ||
{ | ||
$("") | ||
}); | ||
$(function() | ||
{ | ||
$("#menu").metisMenu(); | ||
}); |
Oops, something went wrong.