From 2baa16ae6d8355e0dfb38e400fd4115057b0680d Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 29 Sep 2010 10:00:48 +0000 Subject: Copy plugins into 0.4.1 release branch --- plugins/new_user_dialog/localization/cs_CZ.inc | 7 ++ plugins/new_user_dialog/localization/de_CH.inc | 7 ++ plugins/new_user_dialog/localization/de_DE.inc | 7 ++ plugins/new_user_dialog/localization/en_US.inc | 7 ++ plugins/new_user_dialog/localization/es_ES.inc | 7 ++ plugins/new_user_dialog/localization/et_EE.inc | 7 ++ plugins/new_user_dialog/localization/it_IT.inc | 7 ++ plugins/new_user_dialog/localization/ja_JP.inc | 9 ++ plugins/new_user_dialog/localization/nl_NL.inc | 7 ++ plugins/new_user_dialog/localization/pl_PL.inc | 7 ++ plugins/new_user_dialog/localization/ru_RU.inc | 7 ++ plugins/new_user_dialog/localization/sl_SI.inc | 7 ++ plugins/new_user_dialog/localization/sv_SE.inc | 7 ++ plugins/new_user_dialog/localization/zh_TW.inc | 7 ++ plugins/new_user_dialog/new_user_dialog.php | 126 +++++++++++++++++++++++++ plugins/new_user_dialog/newuserdialog.css | 59 ++++++++++++ plugins/new_user_dialog/package.xml | 100 ++++++++++++++++++++ 17 files changed, 385 insertions(+) create mode 100644 plugins/new_user_dialog/localization/cs_CZ.inc create mode 100644 plugins/new_user_dialog/localization/de_CH.inc create mode 100644 plugins/new_user_dialog/localization/de_DE.inc create mode 100644 plugins/new_user_dialog/localization/en_US.inc create mode 100644 plugins/new_user_dialog/localization/es_ES.inc create mode 100644 plugins/new_user_dialog/localization/et_EE.inc create mode 100644 plugins/new_user_dialog/localization/it_IT.inc create mode 100644 plugins/new_user_dialog/localization/ja_JP.inc create mode 100644 plugins/new_user_dialog/localization/nl_NL.inc create mode 100644 plugins/new_user_dialog/localization/pl_PL.inc create mode 100644 plugins/new_user_dialog/localization/ru_RU.inc create mode 100644 plugins/new_user_dialog/localization/sl_SI.inc create mode 100644 plugins/new_user_dialog/localization/sv_SE.inc create mode 100644 plugins/new_user_dialog/localization/zh_TW.inc create mode 100644 plugins/new_user_dialog/new_user_dialog.php create mode 100644 plugins/new_user_dialog/newuserdialog.css create mode 100644 plugins/new_user_dialog/package.xml (limited to 'plugins/new_user_dialog') diff --git a/plugins/new_user_dialog/localization/cs_CZ.inc b/plugins/new_user_dialog/localization/cs_CZ.inc new file mode 100644 index 000000000..fe05e6aae --- /dev/null +++ b/plugins/new_user_dialog/localization/cs_CZ.inc @@ -0,0 +1,7 @@ + diff --git a/plugins/new_user_dialog/localization/de_CH.inc b/plugins/new_user_dialog/localization/de_CH.inc new file mode 100644 index 000000000..d2a1310d0 --- /dev/null +++ b/plugins/new_user_dialog/localization/de_CH.inc @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/plugins/new_user_dialog/localization/de_DE.inc b/plugins/new_user_dialog/localization/de_DE.inc new file mode 100644 index 000000000..d2a1310d0 --- /dev/null +++ b/plugins/new_user_dialog/localization/de_DE.inc @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/plugins/new_user_dialog/localization/en_US.inc b/plugins/new_user_dialog/localization/en_US.inc new file mode 100644 index 000000000..d9f531ba7 --- /dev/null +++ b/plugins/new_user_dialog/localization/en_US.inc @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/plugins/new_user_dialog/localization/es_ES.inc b/plugins/new_user_dialog/localization/es_ES.inc new file mode 100644 index 000000000..73f47f25a --- /dev/null +++ b/plugins/new_user_dialog/localization/es_ES.inc @@ -0,0 +1,7 @@ + diff --git a/plugins/new_user_dialog/localization/et_EE.inc b/plugins/new_user_dialog/localization/et_EE.inc new file mode 100644 index 000000000..7c6b3f20d --- /dev/null +++ b/plugins/new_user_dialog/localization/et_EE.inc @@ -0,0 +1,7 @@ + diff --git a/plugins/new_user_dialog/localization/it_IT.inc b/plugins/new_user_dialog/localization/it_IT.inc new file mode 100644 index 000000000..6c834a9c8 --- /dev/null +++ b/plugins/new_user_dialog/localization/it_IT.inc @@ -0,0 +1,7 @@ + diff --git a/plugins/new_user_dialog/localization/ja_JP.inc b/plugins/new_user_dialog/localization/ja_JP.inc new file mode 100644 index 000000000..55f47914a --- /dev/null +++ b/plugins/new_user_dialog/localization/ja_JP.inc @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/plugins/new_user_dialog/localization/nl_NL.inc b/plugins/new_user_dialog/localization/nl_NL.inc new file mode 100644 index 000000000..3cc9cec68 --- /dev/null +++ b/plugins/new_user_dialog/localization/nl_NL.inc @@ -0,0 +1,7 @@ + diff --git a/plugins/new_user_dialog/localization/pl_PL.inc b/plugins/new_user_dialog/localization/pl_PL.inc new file mode 100644 index 000000000..a385836a4 --- /dev/null +++ b/plugins/new_user_dialog/localization/pl_PL.inc @@ -0,0 +1,7 @@ + diff --git a/plugins/new_user_dialog/localization/ru_RU.inc b/plugins/new_user_dialog/localization/ru_RU.inc new file mode 100644 index 000000000..d1eb28e71 --- /dev/null +++ b/plugins/new_user_dialog/localization/ru_RU.inc @@ -0,0 +1,7 @@ + diff --git a/plugins/new_user_dialog/localization/sl_SI.inc b/plugins/new_user_dialog/localization/sl_SI.inc new file mode 100644 index 000000000..57f563806 --- /dev/null +++ b/plugins/new_user_dialog/localization/sl_SI.inc @@ -0,0 +1,7 @@ + diff --git a/plugins/new_user_dialog/localization/sv_SE.inc b/plugins/new_user_dialog/localization/sv_SE.inc new file mode 100644 index 000000000..b3e665ef1 --- /dev/null +++ b/plugins/new_user_dialog/localization/sv_SE.inc @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/plugins/new_user_dialog/localization/zh_TW.inc b/plugins/new_user_dialog/localization/zh_TW.inc new file mode 100644 index 000000000..87261f9cd --- /dev/null +++ b/plugins/new_user_dialog/localization/zh_TW.inc @@ -0,0 +1,7 @@ + diff --git a/plugins/new_user_dialog/new_user_dialog.php b/plugins/new_user_dialog/new_user_dialog.php new file mode 100644 index 000000000..5bf8f8497 --- /dev/null +++ b/plugins/new_user_dialog/new_user_dialog.php @@ -0,0 +1,126 @@ +add_hook('identity_create', array($this, 'create_identity')); + $this->register_action('plugin.newusersave', array($this, 'save_data')); + + // register additional hooks if session flag is set + if ($_SESSION['plugin.newuserdialog']) { + $this->add_hook('render_page', array($this, 'render_page')); + } + } + + /** + * Check newly created identity at first login + */ + function create_identity($p) + { + // set session flag when a new user was created and the default identity seems to be incomplete + if ($p['login'] && !$p['complete']) + $_SESSION['plugin.newuserdialog'] = true; + } + + /** + * Callback function when HTML page is rendered + * We'll add an overlay box here. + */ + function render_page($p) + { + if ($_SESSION['plugin.newuserdialog'] && $p['template'] == 'mail') { + $this->add_texts('localization'); + + $rcmail = rcmail::get_instance(); + $identity = $rcmail->user->get_identity(); + $identities_level = intval($rcmail->config->get('identities_level', 0)); + + // compose user-identity dialog + $table = new html_table(array('cols' => 2)); + + $table->add('title', $this->gettext('name')); + $table->add(null, html::tag('input', array( + 'type' => 'text', + 'name' => '_name', + 'value' => $identity['name'] + ))); + + $table->add('title', $this->gettext('email')); + $table->add(null, html::tag('input', array( + 'type' => 'text', + 'name' => '_email', + 'value' => $identity['email'], + 'disabled' => ($identities_level == 1 || $identities_level == 3) + ))); + + // add overlay input box to html page + $rcmail->output->add_footer(html::div(array('id' => 'newuseroverlay'), + html::tag('form', array( + 'action' => $rcmail->url('plugin.newusersave'), + 'method' => 'post'), + html::tag('h3', null, Q($this->gettext('identitydialogtitle'))) . + html::p('hint', Q($this->gettext('identitydialoghint'))) . + $table->show() . + html::p(array('class' => 'formbuttons'), + html::tag('input', array('type' => 'submit', + 'class' => 'button mainaction', 'value' => $this->gettext('save')))) + ) + )); + + // disable keyboard events for messages list (#1486726) + $rcmail->output->add_script( + "$(document).ready(function () { + rcmail.message_list.key_press = function(){}; + rcmail.message_list.key_down = function(){}; + });", 'foot'); + + $this->include_stylesheet('newuserdialog.css'); + } + } + + /** + * Handler for submitted form + * + * Check fields and save to default identity if valid. + * Afterwards the session flag is removed and we're done. + */ + function save_data() + { + $rcmail = rcmail::get_instance(); + $identity = $rcmail->user->get_identity(); + $identities_level = intval($rcmail->config->get('identities_level', 0)); + + $save_data = array( + 'name' => get_input_value('_name', RCUBE_INPUT_POST), + 'email' => get_input_value('_email', RCUBE_INPUT_POST), + ); + + // don't let the user alter the e-mail address if disabled by config + if ($identities_level == 1 || $identities_level == 3) + $save_data['email'] = $identity['email']; + + // save data if not empty + if (!empty($save_data['name']) && !empty($save_data['email'])) { + $rcmail->user->update_identity($identity['identity_id'], $save_data); + $rcmail->session->remove('plugin.newuserdialog'); + } + + $rcmail->output->redirect(''); + } + +} + +?> \ No newline at end of file diff --git a/plugins/new_user_dialog/newuserdialog.css b/plugins/new_user_dialog/newuserdialog.css new file mode 100644 index 000000000..c03e6fd42 --- /dev/null +++ b/plugins/new_user_dialog/newuserdialog.css @@ -0,0 +1,59 @@ +/** Styles for the new-user-dialog overlay box */ + +#newuseroverlay { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 10000; + background: rgba(0,0,0,0.5) !important; + background: #333; + + /** IE hacks */ + filter: alpha(opacity=90); + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=90)"; + width: expression(document.documentElement.clientWidth+'px'); + height: expression(document.documentElement.clientHeight+'px'); +} + +#newuseroverlay h3 { + color: #333; + font-size: normal; + margin-top: 0.5em; + margin-bottom: 0; +} + +#newuseroverlay p.hint { + margin-top: 0.5em; + font-style: italic; +} + +#newuseroverlay form { + width: 32em; + margin: 8em auto; + padding: 1em 2em; + background: #F6F6F6; + border: 2px solid #555; + border-radius: 6px; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; +} + +#newuseroverlay table td.title +{ + color: #666; + text-align: right; + padding-right: 1em; + white-space: nowrap; +} + +#newuseroverlay table td input +{ + width: 20em; +} + +#newuseroverlay .formbuttons { + margin-top: 1.5em; + text-align: center; +} \ No newline at end of file diff --git a/plugins/new_user_dialog/package.xml b/plugins/new_user_dialog/package.xml new file mode 100644 index 000000000..381d45e65 --- /dev/null +++ b/plugins/new_user_dialog/package.xml @@ -0,0 +1,100 @@ + + + new_user_dialog + pear.roundcube.net + Present identities settings dialog to new users + When a new user is created, this plugin checks the default identity and sets a session flag in case it is incomplete. An overlay box will appear on the screen until the user has reviewed/completed his identity. + + Thomas Bruederli + thomasb + roundcube@gmail.com + yes + + 2010-05-27 + + + 1.2 + 1.0 + + + stable + stable + + GNU GPLv2 + +- Add overlay box only to mail task main template +- Fix possible error on form submission (#1486103) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5.2.1 + + + 1.7.0 + + + + + + + 2010-03-29 + + + 1.0 + 1.0 + + + stable + stable + + GNU GPLv2 + + + + 2010-05-13 + + + 1.1 + 1.0 + + + stable + stable + + GNU GPLv2 + +- Fix space bar and backspace buttons not working (#1486726) + + + + -- cgit v1.2.3