Initial Elastic skin support for kolab_delegation and kolab_activesync plugins

This commit is contained in:
Aleksander Machniak 2017-11-03 11:43:31 +01:00
parent 18d9f3b31f
commit fe64e470c8
12 changed files with 220 additions and 49 deletions

View file

@ -377,7 +377,7 @@ class kolab_2fa extends rcube_plugin
// register as settings action
$args['actions'][] = array(
'action' => 'plugin.kolab-2fa',
'class' => '2factorauth',
'class' => 'twofactorauth',
'label' => 'settingslist',
'title' => 'settingstitle',
'domain' => 'kolab_2fa',
@ -397,7 +397,7 @@ class kolab_2fa extends rcube_plugin
$this->register_handler('plugin.highsecuritydialog', array($this, 'settings_highsecuritydialog'));
$this->include_script('kolab2fa.js');
$this->include_stylesheet($this->local_skin_path() . '/kolab2fa.css');
$this->include_stylesheet($this->local_skin_path() . '/kolab2fa.css', true);
if ($this->check_secure_mode()) {
$this->api->output->set_env('session_secured', $_SESSION['kolab_2fa_secure_mode']);

View file

@ -109,7 +109,7 @@ class kolab_activesync extends rcube_plugin
if ($content = $this->ui->folder_options_table($mbox_imap, $devices, $type)) {
$args['form']['activesync'] = array(
'name' => rcube::Q($this->gettext('tabtitle')),
'name' => $this->gettext('tabtitle'),
'content' => $content,
);
}

View file

@ -39,7 +39,7 @@ class kolab_activesync_ui
$skin_path = $this->plugin->local_skin_path() . '/';
$this->skin_path = 'plugins/kolab_activesync/' . $skin_path;
$this->plugin->include_stylesheet($skin_path . 'config.css');
$this->plugin->include_stylesheet($skin_path . 'config.css', true);
}
public function device_list($attrib = array())
@ -52,7 +52,8 @@ class kolab_activesync_ui
foreach ($devices as $id => $device) {
$name = $device['ALIAS'] ? $device['ALIAS'] : $id;
$table->add_row(array('id' => 'rcmrow' . $id));
$table->add(null, html::span('devicealias', rcube::Q($name)) . html::span('devicetype', rcube::Q($device['TYPE'])));
$table->add(null, html::span('devicealias', rcube::Q($name))
. ' ' . html::span('devicetype secondary', rcube::Q($device['TYPE'])));
}
$this->rc->output->add_gui_object('devicelist', $attrib['id']);
@ -79,7 +80,7 @@ class kolab_activesync_ui
if (!empty($info)) {
foreach ($info as $key => $value) {
if ($value) {
$table->add('title', rcube::Q($this->plugin->gettext($key)));
$table->add('title', html::label(null, rcube::Q($this->plugin->gettext($key))));
$table->add(null, rcube::Q($value));
}
}
@ -95,12 +96,14 @@ class kolab_activesync_ui
public function folder_subscriptions($attrib = array())
{
if (!$attrib['id'])
if (!$attrib['id']) {
$attrib['id'] = 'foldersubscriptions';
}
// group folders by type (show only known types)
$folder_groups = array('mail' => array(), 'contact' => array(), 'event' => array(), 'task' => array(), 'note' => array());
$folder_types = kolab_storage::folders_typedata();
$use_fieldsets = rcube_utils::get_boolean($attrib['use-fieldsets']);
$imei = $this->device['_id'];
$subscribed = array();
@ -132,10 +135,17 @@ class kolab_activesync_ui
if (empty($group)) {
continue;
}
$attrib['type'] = $type;
$html .= html::div('subscriptionblock',
html::tag('h3', $type, $this->plugin->gettext($type)) .
$this->folder_subscriptions_block($group, $attrib, $subscribed));
$table = $this->folder_subscriptions_block($group, $attrib, $subscribed);
$label = $this->plugin->gettext($type);
if ($use_fieldsets) {
$html .= html::tag('fieldset', 'subscriptionblock', html::tag('legend', $type, $label) . $table);
}
else {
$html .= html::div('subscriptionblock', html::tag('h3', $type, $label) . $table);
}
}
$this->rc->output->add_gui_object('subscriptionslist', $attrib['id']);
@ -148,14 +158,26 @@ class kolab_activesync_ui
$alarms = ($attrib['type'] == 'event' || $attrib['type'] == 'task');
$table = new html_table(array('cellspacing' => 0));
$table->add_header(array('class' => 'subscription', 'title' => $this->plugin->gettext('synchronize'), 'tabindex' => 0),
$table->add_header(array(
'class' => 'subscription checkbox-cell',
'title' => $this->plugin->gettext('synchronize'),
'tabindex' => 0
),
$attrib['syncicon'] ? html::img(array('src' => $this->skin_path . $attrib['syncicon'])) :
$this->plugin->gettext('synchronize'));
$this->plugin->gettext('synchronize')
);
if ($alarms) {
$table->add_header(array('class' => 'alarm', 'title' => $this->plugin->gettext('withalarms'), 'tabindex' => 0),
$table->add_header(array(
'class' => 'alarm checkbox-cell',
'title' => $this->plugin->gettext('withalarms'),
'tabindex' => 0
),
$attrib['alarmicon'] ? html::img(array('src' => $this->skin_path . $attrib['alarmicon'])) :
$this->plugin->gettext('withalarms'));
$this->plugin->gettext('withalarms')
);
}
$table->add_header('foldername', $this->plugin->gettext('folder'));
$checkbox_sync = new html_checkbox(array('name' => 'subscribed[]', 'class' => 'subscription'));
@ -186,12 +208,12 @@ class kolab_activesync_ui
}
$table->add_row();
$table->add('subscription', $checkbox_sync->show(
$table->add('subscription checkbox-cell', $checkbox_sync->show(
!empty($subscribed[$folder]) ? $folder : null,
array('value' => $folder, 'id' => $folder_id)));
if ($alarms) {
$table->add('alarm', $checkbox_alarm->show(
$table->add('alarm checkbox-cell', $checkbox_alarm->show(
intval($subscribed[$folder]) > 1 ? $folder : null,
array('value' => $folder, 'id' => $folder_id.'_alarm')));
}
@ -236,13 +258,13 @@ class kolab_activesync_ui
$table->add_row();
$table->add(array('class' => 'device', 'title' => $title), $name);
$table->add('subscription', $checkbox->show(!empty($folder_data[$id]['S']) ? 1 : 0));
$table->add('subscription checkbox-cell', $checkbox->show(!empty($folder_data[$id]['S']) ? 1 : 0));
if ($alarms) {
$checkbox_alarm = new html_checkbox(array('name' => "_alarms[$id]", 'value' => 1,
'onchange' => 'return activesync_object.update_sync_data(this)'));
$table->add('alarm', $checkbox_alarm->show($folder_data[$id]['S'] > 1 ? 1 : 0));
$table->add('alarm checkbox-cell', $checkbox_alarm->show($folder_data[$id]['S'] > 1 ? 1 : 0));
}
}

View file

@ -10,7 +10,7 @@ $labels['syncsettings'] = 'Synchronization settings';
$labels['deviceconfig'] = 'Device configuration';
$labels['folderstosync'] = 'Folders to synchronize';
$labels['mail'] = 'Email';
$labels['contact'] = 'Address Books';
$labels['contact'] = 'Contacts';
$labels['event'] = 'Calendars';
$labels['task'] = 'Tasks';
$labels['note'] = 'Notes';

View file

@ -0,0 +1,39 @@
<roundcube:include file="includes/layout.html" />
<roundcube:include file="includes/menu.html" />
<roundcube:include file="includes/settings-menu.html" />
<h1 class="voice"><roundcube:label name="kolab_activesync.tabtitle" /></h1>
<!-- devices list -->
<div class="list listbox selected" aria-labelledby="aria-label-deviceslist">
<div class="header">
<a class="button icon menu-button" href="#menu"><span class="inner"><roundcube:label name="menu" /></span></a>
<a class="button icon back-sidebar-button" href="#sidebar"><span class="inner"><roundcube:label name="settings" /></span></a>
<span id="aria-label-deviceslist" class="header-title"><roundcube:label name="kolab_activesync.devices" /></span>
<a class="button icon toolbar-menu-button" href="#list-menu"><span class="inner"><roundcube:label name="menu" /></span></a>
</div>
<div class="scroller">
<roundcube:object name="plugin.devicelist" id="devices-table" class="listing" role="listbox" />
</div>
<!--
<div class="footer"></div>
-->
</div>
<!-- device info frame -->
<div class="content" role="main">
<h2 id="aria-label-toolbar" class="voice"><roundcube:label name="arialabeltoolbar" /></h2>
<div class="header" role="toolbar" aria-labelledby="aria-label-toolbar">
<a class="button icon back-list-button" href="#back"><span class="inner"><roundcube:label name="back" /></span></a>
<span class="header-title"></span>
<!-- toolbar -->
<div class="toolbar">
<roundcube:button command="plugin.delete-device" type="link"
class="button delete disabled" classAct="button delete"
label="delete" title="kolab_activesync.deletedevice" innerclass="inner" />
</div>
</div>
<roundcube:frame contentframe="activesync-frame" id="activesync-frame" src="/watermark.html" title="arialabeldeviceframe" />
</div>
<roundcube:include file="includes/footer.html" />

View file

@ -0,0 +1,23 @@
<roundcube:include file="includes/layout.html" />
<h1 class="voice"><roundcube:label name="kolab_activesync.syncsettings" /></h1>
<div class="formcontent">
<form action="#" method="post" id="configform" class="propform">
<fieldset>
<legend><roundcube:label name="kolab_activesync.deviceconfig" /></legend>
<roundcube:object name="plugin.deviceconfigform" form="configform" class="propform" />
</fieldset>
<fieldset>
<legend><roundcube:label name="kolab_activesync.folderstosync" /></legend>
<roundcube:object name="plugin.foldersubscriptions" form="configform"
id="foldersubscriptions" use-fieldsets="true" class="tabbed" />
</fieldset>
</form>
</div>
<div class="formbuttons">
<roundcube:button command="plugin.save-config" class="btn btn-primary submit" label="save" />
</div>
<roundcube:include file="includes/footer.html" />

View file

@ -0,0 +1,11 @@
<roundcube:include file="includes/layout.html" />
<h1 class="voice"><roundcube:label name="kolab_activesync.syncsettings" /></h1>
<div class="formcontent">
<div class="boxinformation">
<roundcube:object name="initmessage" />
</div>
</div>
<roundcube:include file="includes/footer.html" />

View file

@ -164,29 +164,24 @@ rcube_webmail.prototype.delegate_delete = function()
if (!this.env.active_delegate)
return;
var $dialog = $("#delegate-delete-dialog").addClass('uidialog'),
buttons = {};
buttons[this.gettext('no', 'kolab_delegation')] = function() {
$dialog.dialog('close');
};
buttons[this.gettext('yes', 'kolab_delegation')] = function() {
$dialog.dialog('close');
var lock = rcmail.set_busy(true, 'kolab_delegation.savingdata');
rcmail.http_post('plugin.delegation-delete', {id: rcmail.env.active_delegate,
acl: $("#delegate-delete-dialog input:checked").length}, lock);
}
// open jquery UI dialog
$dialog.dialog({
modal: true,
var content = $("#delegate-delete-dialog").addClass('uidialog').clone(),
title = this.gettext('deleteconfirm', 'kolab_delegation'),
save_func = function() {
var lock = rcmail.set_busy(true, 'kolab_delegation.savingdata'),
props = {id: rcmail.env.active_delegate, acl: $("#delegate-delete-dialog input:checked").length};
rcmail.http_post('plugin.delegation-delete', props, lock);
return true;
},
opts = {
resizable: false,
closeOnEscape: true,
title: this.gettext('deleteconfirm', 'kolab_delegation'),
close: function() { $dialog.dialog('destroy').hide(); },
buttons: buttons,
width: 400
}).show();
width: 400,
button: 'kolab_delegation.yes',
cancel_button: 'kolab_delegation.no'
};
// open jquery UI dialog
this.simple_dialog(content, title, save_func, opts);
};
// submit delegate form to the server

View file

@ -78,7 +78,7 @@ class kolab_delegation extends rcube_plugin
}
$this->skin_path = $this->local_skin_path();
$this->include_stylesheet($this->skin_path . '/style.css');
$this->include_stylesheet($this->skin_path . '/style.css', true);
}
}
// Calendar/Tasklist plugin UI bindings
@ -487,6 +487,7 @@ class kolab_delegation extends rcube_plugin
}
$folder_data = $engine->list_folders($delegate['uid']);
$use_fieldsets = rcube_utils::get_boolean($attrib['use-fieldsets']);
$rights = array();
$folder_groups = array();
@ -500,10 +501,17 @@ class kolab_delegation extends rcube_plugin
if (empty($group)) {
continue;
}
$attrib['type'] = $type;
$html .= html::div('foldersblock',
html::tag('h3', $type, $this->gettext($type)) .
$this->delegate_folders_block($group, $attrib, $rights));
$table = $this->delegate_folders_block($group, $attrib, $rights);
$label = $this->gettext($type);
if ($use_fieldsets) {
$html .= html::tag('fieldset', 'foldersblock', html::tag('legend', $type, $label) . $table);
}
else {
$html .= html::div('foldersblock', html::tag('h3', $type, $label) . $table);
}
}
$this->rc->output->add_gui_object('folderslist', $attrib['id']);
@ -521,8 +529,8 @@ class kolab_delegation extends rcube_plugin
$write_ico = $attrib['writeicon'] ? html::img(array('src' => $path . $attrib['writeicon'], 'title' => $this->gettext('write'))) : '';
$table = new html_table(array('cellspacing' => 0));
$table->add_header(array('class' => 'read', 'title' => $this->gettext('read'), 'tabindex' => 0), $read_ico);
$table->add_header(array('class' => 'write', 'title' => $this->gettext('write'), 'tabindex' => 0), $write_ico);
$table->add_header(array('class' => 'read checkbox-cell', 'title' => $this->gettext('read'), 'tabindex' => 0), $read_ico);
$table->add_header(array('class' => 'write checkbox-cell', 'title' => $this->gettext('write'), 'tabindex' => 0), $write_ico);
$table->add_header('foldername', $this->rc->gettext('folder'));
$checkbox_read = new html_checkbox(array('name' => 'read[]', 'class' => 'read'));
@ -553,10 +561,10 @@ class kolab_delegation extends rcube_plugin
}
$table->add_row();
$table->add('read', $checkbox_read->show(
$table->add('read checkbox-cell', $checkbox_read->show(
$rights[$folder] >= kolab_delegation_engine::ACL_READ ? $folder : null,
array('value' => $folder)));
$table->add('write', $checkbox_write->show(
$table->add('write checkbox-cell', $checkbox_write->show(
$rights[$folder] >= kolab_delegation_engine::ACL_WRITE ? $folder : null,
array('value' => $folder, 'id' => $folder_id)));

View file

@ -14,8 +14,10 @@ $labels['tabtitle'] = 'Delegation';
$labels['delegationtitle'] = 'Manage delegates';
$labels['delegates'] = 'Delegates';
$labels['delegate'] = 'Delegate';
$labels['delegatefolders'] = 'Delegated folders';
$labels['delegateprops'] = 'Delegate properties';
$labels['mail'] = 'Email';
$labels['contact'] = 'Address Books';
$labels['contact'] = 'Contacts';
$labels['event'] = 'Calendars';
$labels['task'] = 'Tasks';
$labels['note'] = 'Notes';

View file

@ -0,0 +1,23 @@
<roundcube:include file="includes/layout.html" />
<h1 class="voice"><roundcube:label name="kolab_delegation.delegate" /></h1>
<div class="formcontent">
<form action="#" method="post" id="delegateform" class="propform">
<fieldset>
<legend><roundcube:label name="kolab_delegation.delegateprops" /></legend>
<roundcube:object name="plugin.delegateform" form="delegateform" class="propform" />
</fieldset>
<fieldset>
<legend><roundcube:label name="kolab_delegation.delegatefolders" /></legend>
<roundcube:object name="plugin.delegatefolders" form="delegateform"
id="delegatefolders" use-fieldsets="true" class="tabbed" />
</fieldset>
</form>
</div>
<div class="formbuttons">
<roundcube:button command="delegate-save" class="btn btn-primary submit" label="save" />
</div>
<roundcube:include file="includes/footer.html" />

View file

@ -0,0 +1,48 @@
<roundcube:include file="includes/layout.html" />
<roundcube:include file="includes/menu.html" />
<roundcube:include file="includes/settings-menu.html" />
<h1 class="voice"><roundcube:label name="kolab_delegation.tabtitle" /></h1>
<!-- devices list -->
<div class="list listbox selected" aria-labelledby="aria-label-delegateslist">
<div class="header">
<a class="button icon menu-button" href="#menu"><span class="inner"><roundcube:label name="menu" /></span></a>
<a class="button icon back-sidebar-button" href="#sidebar"><span class="inner"><roundcube:label name="settings" /></span></a>
<span id="aria-label-delegateslist" class="header-title"><roundcube:label name="kolab_delegation.delegates" /></span>
<a class="button icon toolbar-menu-button" href="#list-menu"><span class="inner"><roundcube:label name="menu" /></span></a>
</div>
<div class="scroller">
<roundcube:object name="plugin.delegatelist" id="delegate-table" class="listing" role="listbox" />
</div>
<!--
<div class="footer"></div>
-->
</div>
<!-- delegatee info frame -->
<div class="content" role="main">
<h2 id="aria-label-toolbar" class="voice"><roundcube:label name="arialabeltoolbar" /></h2>
<div class="header" role="toolbar" aria-labelledby="aria-label-toolbar">
<a class="button icon back-list-button" href="#back"><span class="inner"><roundcube:label name="back" /></span></a>
<span class="header-title"></span>
<!-- toolbar -->
<div class="toolbar">
<roundcube:button command="delegate-add" type="link"
label="create" title="kolab_delegation.adddelegate"
class="button create disabled" classAct="button create" innerClass="inner" />
<roundcube:button command="delegate-delete" type="link"
class="button delete disabled" classAct="button delete"
label="delete" title="kolab_delegation.deletedelegate" innerclass="inner" />
</div>
</div>
<roundcube:frame contentframe="delegation-frame" id="delegation-frame" src="/watermark.html" title="arialabeldelegateform" />
</div>
<div id="delegate-delete-dialog" class="popupmenu" role="dialog" aria-labelledby="aria-label-delegatedeletedialog" aria-hidden="true">
<h3 id="aria-label-delegatedeletedialog" class="voice"><roundcube:label name="kolab_delegation.arialabeldelegatedelete" /></h3>
<p><roundcube:label name="kolab_delegation.delegatedeleteconfirm" /></p>
<span><input type="checkbox" value="1" checked="checked" /><roundcube:label name="kolab_delegation.delegateremoveacl" /></span>
</div>
<roundcube:include file="includes/footer.html" />