Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F6562609
header.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
header.php
View Options
<?php
/**
* _, __, _, _ __, _ _, _, _
* / \ |_) (_ | | \ | /_\ |\ |
* \ / |_) , ) | |_/ | | | | \|
* ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
*
* Controller for header (called on every regular page)
*
* @package ObsidianWorkspaces
* @subpackage Controllers
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @filesource
*
*/
/**
* Header controller
*/
class
HeaderController
extends
Controller
{
/**
* Handles controller request
*/
public
function
handleRequest
()
{
//Gets header resources
$workspaces
=
$this
->
context
->
user
->
get_workspaces
();
//HTML output
$smarty
=
$this
->
context
->
templateEngine
;
$smarty
->
assign
(
'current_username'
,
$this
->
context
->
user
->
name
);
$smarty
->
assign
(
'workspaces'
,
$workspaces
);
$smarty
->
assign
(
'workspaces_count'
,
count
(
$workspaces
));
if
(
$this
->
context
->
workspace
!==
null
)
{
$workspace
=
$this
->
context
->
workspace
;
$smarty
->
assign
(
'current_workspace'
,
$workspace
);
//Gets custom header
if
(
$workspace
->
configuration
->
header
!=
''
)
{
$customHeader
=
file_get_contents
(
$workspace
->
configuration
->
header
);
$smarty
->
assign
(
'custom_workspace_header'
,
$customHeader
);
}
//Gets navigation
$nav
=
[];
$binds
=
$workspace
->
configuration
->
getControllersBinds
();
foreach
(
$binds
as
$applicationConfig
)
{
if
(
$applicationConfig
->
nav
!==
null
)
{
$nav
[]
=
[
'link'
=>
$applicationConfig
->
nav
->
__toString
(),
'url'
=>
$applicationConfig
->
bind
,
'icon'
=>
$applicationConfig
->
icon
];
}
}
$smarty
->
assign
(
'current_workspace_nav'
,
$nav
);
}
$smarty
->
display
(
'header.tpl'
);
define
(
'HEADER_PRINTED'
,
true
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Apr 2, 18:04 (12 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2535284
Default Alt Text
header.php (2 KB)
Attached To
Mode
rOBSIDIAN Obsidian Workspaces
Attached
Detach File
Event Timeline
Log In to Comment