Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117878545
kolab_client_task_main.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
kolab_client_task_main.php
View Options
<?php
/*
+--------------------------------------------------------------------------+
| This file is part of the Kolab Web Admin Panel |
| |
| Copyright (C) 2011-2012, Kolab Systems AG |
| |
| This program is free software: you can redistribute it and/or modify |
| it under the terms of the GNU Affero General Public License as published |
| by the Free Software Foundation, either version 3 of the License, or |
| (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU Affero General Public License for more details. |
| |
| You should have received a copy of the GNU Affero General Public License |
| along with this program. If not, see <http://www.gnu.org/licenses/> |
+--------------------------------------------------------------------------+
| Author: Aleksander Machniak <machniak@kolabsys.com> |
+--------------------------------------------------------------------------+
*/
class
kolab_client_task_main
extends
kolab_client_task
{
protected
$_menu
=
array
(
'user'
=>
'users'
,
'group'
=>
'groups'
,
'domain'
=>
'domains'
,
'role'
=>
'roles'
,
'resource'
=>
'resources'
,
'settings'
=>
'settings'
,
'about'
=>
'about'
,
);
public
function
action_default
()
{
// handle domain change
if
(
$domain
=
$this
->
get_input
(
'domain'
,
'GET'
))
{
$result
=
$this
->
api_get
(
'system.select_domain'
,
array
(
'domain'
=>
$domain
));
if
(!
$result
->
get_error_code
())
{
$_SESSION
[
'user'
][
'domain'
]
=
$domain
;
}
else
{
$this
->
output
->
command
(
'display_message'
,
$this
->
translate
(
'error.domainselect'
),
'error'
);
}
}
// assign token
$this
->
output
->
set_env
(
'token'
,
$_SESSION
[
'user'
][
'token'
]);
// add watermark content
$this
->
output
->
set_env
(
'watermark'
,
$this
->
output
->
get_template
(
'watermark'
));
// assign default set of translations
$this
->
output
->
add_translation
(
'loading'
,
'saving'
,
'deleting'
,
'servererror'
,
'search'
,
'search.loading'
,
'search.acchars'
);
// Create list of tasks for dashboard
$capabilities
=
$this
->
capabilities
();
$this
->
menu
=
array
();
foreach
(
$this
->
_menu
as
$task
=>
$api_task
)
{
if
(
$task
!=
'about'
&&
!
array_key_exists
(
$api_task
.
'.list'
,
(
array
)
$capabilities
[
'actions'
]))
{
$task_class
=
'kolab_client_task_'
.
$task
;
if
(!
method_exists
(
$task_class
,
'is_enabled'
)
||
!
$task_class
::
is_enabled
(
$capabilities
[
'actions'
]))
{
continue
;
}
}
$this
->
menu
[
$task
.
'.default'
]
=
'menu.'
.
(
$api_task
?
$api_task
:
$task
);
}
$this
->
output
->
assign
(
'tasks'
,
$this
->
menu
);
$this
->
output
->
assign
(
'main_menu'
,
$this
->
menu
());
$this
->
output
->
assign
(
'user'
,
$_SESSION
[
'user'
]);
// Domains list
if
(
$domains
=
$this
->
get_domains
())
{
sort
(
$domains
,
SORT_LOCALE_STRING
);
$this
->
output
->
set_env
(
'domains'
,
$domains
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Apr 5, 10:18 PM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18719193
Default Alt Text
kolab_client_task_main.php (3 KB)
Attached To
Mode
rWAP webadmin
Attached
Detach File
Event Timeline