pull/314/head 1.2-beta
Aleksander Machniak 9 years ago
parent 2d40b43faa
commit 9f1f754daf

@ -123,7 +123,7 @@ class acl extends rcube_plugin
$group_id = is_array($record[$group_field]) ? $record[$group_field][0] : $record[$group_field];
if ($group) {
$users[] = array('name' => ($prefix ? $prefix : '') . $group_id, 'display' => $group, 'type' => 'group');
$users[] = array('name' => ($prefix ?: '') . $group_id, 'display' => $group, 'type' => 'group');
$keys[] = $group;
}
}

@ -155,7 +155,7 @@ class database_attachments extends filesystem_attachments
*/
protected function _key($args)
{
$uname = $args['path'] ? $args['path'] : $args['name'];
$uname = $args['path'] ?: $args['name'];
return $args['group'] . md5(time() . $uname . $_SESSION['user_id']);
}

@ -18,7 +18,7 @@
* @version @package_version@
* @author Ziba Scott
* @website http://roundcube.net
*
*
* Example:
*
* config.inc.php:

@ -130,7 +130,7 @@ class runlog {
$this->debug_messages[] = $msg;
$this->run_log[] = array(
'type' => 'note',
'tag' => $tag ? $tag:"text",
'tag' => $tag ?: 'text',
'value' => htmlentities($msg),
'time' => microtime(true),
'parents' => $this->parent_stack,

@ -51,11 +51,6 @@ class enigma_error
function getData($name)
{
if ($name) {
return $this->data[$name];
}
else {
return $this->data;
}
return $name ? $this->data[$name] : $this->data;
}
}

@ -264,7 +264,7 @@ class enigma_mime_message extends Mail_mime
{
$this->checkParams();
$eol = !empty($this->build_params['eol']) ? $this->build_params['eol'] : "\r\n";
$eol = $this->build_params['eol'] ?: "\r\n";
// multipart message: and boundary
if (!empty($this->build_params['boundary'])) {

@ -155,9 +155,10 @@ class help extends rcube_plugin
private function resolve_language($path)
{
// resolve language placeholder
$rcmail = rcmail::get_instance();
$rcmail = rcmail::get_instance();
$langmap = $rcmail->config->get('help_language_map', array('*' => 'en_US'));
$lang = !empty($langmap[$_SESSION['language']]) ? $langmap[$_SESSION['language']] : $langmap['*'];
$lang = $langmap[$_SESSION['language']] ?: $langmap['*'];
return str_replace('%l', $lang, $path);
}
}

@ -59,8 +59,8 @@ class hide_blockquote extends rcube_plugin
$input = new html_inputfield(array('name' => '_'.$field_id, 'id' => $field_id, 'size' => 5));
$args['blocks']['main']['options']['hide_blockquote_limit'] = array(
'title' => $this->gettext('quotelimit'),
'content' => $input->show($limit ? $limit : '')
'title' => $this->gettext('quotelimit'),
'content' => $input->show($limit ?: '')
);
return $args;

@ -93,7 +93,7 @@ class http_authentication extends rcube_plugin
// We'll set it back on startup (#1486553)
rcmail::get_instance()->session->remove('password');
}
function login($args)
{
// Redirect to the previous QUERY_STRING

@ -111,7 +111,7 @@ class rcube_sieve
*/
public function error()
{
return $this->error ? $this->error : false;
return $this->error ?: false;
}
/**

@ -633,8 +633,8 @@ class rcube_sieve_engine
foreach ($sizeitems as $item)
$items[] = $item;
$this->form['disabled'] = $_POST['_disabled'] ? true : false;
$this->form['join'] = $join=='allof' ? true : false;
$this->form['disabled'] = !empty($_POST['_disabled']);
$this->form['join'] = $join == 'allof';
$this->form['name'] = $name;
$this->form['tests'] = array();
$this->form['actions'] = array();
@ -1685,7 +1685,7 @@ class rcube_sieve_engine
$test = $rule['type'];
}
else if (in_array($rule['test'], $set)) {
$test = ($rule['not'] ? 'not' : '') . ($rule['type'] ? $rule['type'] : 'is');
$test = ($rule['not'] ? 'not' : '') . ($rule['type'] ?: 'is');
}
else {
$test = ($rule['not'] ? 'not' : '') . $rule['test'];
@ -2358,7 +2358,7 @@ class rcube_sieve_engine
if (empty($filter['actions'])) {
continue;
}
$fname = $filter['name'] ? $filter['name'] : "#$i";
$fname = $filter['name'] ?: "#$i";
$result[] = array(
'id' => $idx,
'name' => $fname,

@ -312,7 +312,7 @@ class rcube_sieve_vacation extends rcube_sieve_engine
}
}
$this->rc->output->show_message($error ? $error : 'managesieve.saveerror', 'error');
$this->rc->output->show_message($error ?: 'managesieve.saveerror', 'error');
$this->rc->output->send();
}
@ -327,7 +327,7 @@ class rcube_sieve_vacation extends rcube_sieve_engine
$seconds_extension = in_array('vacation-seconds', $this->exts);
// build FORM tag
$form_id = !empty($attrib['id']) ? $attrib['id'] : 'form';
$form_id = $attrib['id'] ?: 'form';
$out = $this->rc->output->request_form(array(
'id' => $form_id,
'name' => $form_id,
@ -597,7 +597,7 @@ class rcube_sieve_vacation extends rcube_sieve_engine
}
}
return $interval ? $interval : '';
return $interval ?: '';
}
/**

@ -239,7 +239,7 @@ class managesieve extends rcube_plugin
$include_path .= ini_get('include_path');
set_include_path($include_path);
$class_name = 'rcube_sieve_' . ($type ? $type : 'engine');
$class_name = 'rcube_sieve_' . ($type ?: 'engine');
$this->engine = new $class_name($this);
}

@ -12,64 +12,67 @@
*/
class markasjunk extends rcube_plugin
{
public $task = 'mail';
public $task = 'mail';
function init()
{
$rcmail = rcmail::get_instance();
function init()
{
$rcmail = rcmail::get_instance();
$this->register_action('plugin.markasjunk', array($this, 'request_action'));
$this->add_hook('storage_init', array($this, 'storage_init'));
$this->register_action('plugin.markasjunk', array($this, 'request_action'));
$this->add_hook('storage_init', array($this, 'storage_init'));
if ($rcmail->action == '' || $rcmail->action == 'show') {
$skin_path = $this->local_skin_path();
$this->include_script('markasjunk.js');
if (is_file($this->home . "/$skin_path/markasjunk.css"))
$this->include_stylesheet("$skin_path/markasjunk.css");
$this->add_texts('localization', true);
if ($rcmail->action == '' || $rcmail->action == 'show') {
$skin_path = $this->local_skin_path();
$this->add_button(array(
'type' => 'link',
'label' => 'buttontext',
'command' => 'plugin.markasjunk',
'class' => 'button buttonPas junk disabled',
'classact' => 'button junk',
'title' => 'buttontitle',
'domain' => 'markasjunk'), 'toolbar');
}
}
function storage_init($args)
{
$flags = array(
'JUNK' => 'Junk',
'NONJUNK' => 'NonJunk',
);
$this->add_texts('localization', true);
$this->include_script('markasjunk.js');
// register message flags
$args['message_flags'] = array_merge((array)$args['message_flags'], $flags);
if (is_file($this->home . "/$skin_path/markasjunk.css")) {
$this->include_stylesheet("$skin_path/markasjunk.css");
}
return $args;
}
$this->add_button(array(
'type' => 'link',
'label' => 'buttontext',
'command' => 'plugin.markasjunk',
'class' => 'button buttonPas junk disabled',
'classact' => 'button junk',
'title' => 'buttontitle',
'domain' => 'markasjunk'
),'toolbar');
}
}
function request_action()
{
$this->add_texts('localization');
function storage_init($args)
{
$flags = array(
'JUNK' => 'Junk',
'NONJUNK' => 'NonJunk',
);
$rcmail = rcmail::get_instance();
$storage = $rcmail->get_storage();
// register message flags
$args['message_flags'] = array_merge((array)$args['message_flags'], $flags);
foreach (rcmail::get_uids() as $mbox => $uids) {
$storage->unset_flag($uids, 'NONJUNK', $mbox);
$storage->set_flag($uids, 'JUNK', $mbox);
return $args;
}
if (($junk_mbox = $rcmail->config->get('junk_mbox'))) {
$rcmail->output->command('move_messages', $junk_mbox);
}
function request_action()
{
$this->add_texts('localization');
$rcmail->output->command('display_message', $this->gettext('reportedasjunk'), 'confirmation');
$rcmail->output->send();
}
$rcmail = rcmail::get_instance();
$storage = $rcmail->get_storage();
foreach (rcmail::get_uids() as $mbox => $uids) {
$storage->unset_flag($uids, 'NONJUNK', $mbox);
$storage->set_flag($uids, 'JUNK', $mbox);
}
if (($junk_mbox = $rcmail->config->get('junk_mbox'))) {
$rcmail->output->command('move_messages', $junk_mbox);
}
$rcmail->output->command('display_message', $this->gettext('reportedasjunk'), 'confirmation');
$rcmail->output->send();
}
}

@ -90,7 +90,7 @@ class redundant_attachments extends filesystem_attachments
*/
private function _key($args)
{
$uname = $args['path'] ? $args['path'] : $args['name'];
$uname = $args['path'] ?: $args['name'];
return $args['group'] . md5(time() . $uname . $_SESSION['user_id']);
}

@ -61,7 +61,7 @@ class subscriptions_option extends rcube_plugin
$rcmail = rcmail::get_instance();
$use_subscriptions = $rcmail->config->get('use_subscriptions');
$args['prefs']['use_subscriptions'] = isset($_POST['_use_subscriptions']) ? true : false;
$args['prefs']['use_subscriptions'] = isset($_POST['_use_subscriptions']);
// if the use_subscriptions preference changes, flush the folder cache
if (($use_subscriptions && !isset($_POST['_use_subscriptions'])) ||

@ -6,50 +6,49 @@
*/
class userinfo extends rcube_plugin
{
public $task = 'settings';
public $noajax = true;
public $noframe = true;
function init()
{
$this->add_texts('localization/', array('userinfo'));
$this->register_action('plugin.userinfo', array($this, 'infostep'));
$this->include_script('userinfo.js');
}
function infostep()
{
$this->register_handler('plugin.body', array($this, 'infohtml'));
rcmail::get_instance()->output->send('plugin');
}
function infohtml()
{
$rcmail = rcmail::get_instance();
$user = $rcmail->user;
$table = new html_table(array('cols' => 2, 'cellpadding' => 3));
$table->add('title', 'ID');
$table->add('', rcube::Q($user->ID));
$table->add('title', rcube::Q($this->gettext('username')));
$table->add('', rcube::Q($user->data['username']));
$table->add('title', rcube::Q($this->gettext('server')));
$table->add('', rcube::Q($user->data['mail_host']));
$table->add('title', rcube::Q($this->gettext('created')));
$table->add('', rcube::Q($user->data['created']));
$table->add('title', rcube::Q($this->gettext('lastlogin')));
$table->add('', rcube::Q($user->data['last_login']));
$identity = $user->get_identity();
$table->add('title', rcube::Q($this->gettext('defaultidentity')));
$table->add('', rcube::Q($identity['name'] . ' <' . $identity['email'] . '>'));
return html::tag('h4', null, rcube::Q('Infos for ' . $user->get_username())) . $table->show();
}
public $task = 'settings';
public $noajax = true;
public $noframe = true;
function init()
{
$this->add_texts('localization/', array('userinfo'));
$this->register_action('plugin.userinfo', array($this, 'infostep'));
$this->include_script('userinfo.js');
}
function infostep()
{
$this->register_handler('plugin.body', array($this, 'infohtml'));
rcmail::get_instance()->output->send('plugin');
}
function infohtml()
{
$rcmail = rcmail::get_instance();
$user = $rcmail->user;
$identity = $user->get_identity();
$table = new html_table(array('cols' => 2, 'cellpadding' => 3));
$table->add('title', 'ID');
$table->add('', rcube::Q($user->ID));
$table->add('title', rcube::Q($this->gettext('username')));
$table->add('', rcube::Q($user->data['username']));
$table->add('title', rcube::Q($this->gettext('server')));
$table->add('', rcube::Q($user->data['mail_host']));
$table->add('title', rcube::Q($this->gettext('created')));
$table->add('', rcube::Q($user->data['created']));
$table->add('title', rcube::Q($this->gettext('lastlogin')));
$table->add('', rcube::Q($user->data['last_login']));
$table->add('title', rcube::Q($this->gettext('defaultidentity')));
$table->add('', rcube::Q($identity['name'] . ' <' . $identity['email'] . '>'));
return html::tag('h4', null, rcube::Q('Infos for ' . $user->get_username())) . $table->show();
}
}

@ -156,7 +156,7 @@ class zipdownload extends rcube_plugin
$zip->close();
$filename = ($message->subject ? $message->subject : 'roundcube') . '.zip';
$filename = ($message->subject ?: 'roundcube') . '.zip';
$this->_deliver_zipfile($tmpfname, $filename);
// delete temporary files from disk
@ -247,7 +247,7 @@ class zipdownload extends rcube_plugin
$subject = $this->_convert_filename($subject);
$subject = substr($subject, 0, 16);
$disp_name = ($subject ? $subject : 'message_rfc822') . ".eml";
$disp_name = ($subject ?: 'message_rfc822') . ".eml";
$disp_name = $path . $uid . "_" . $disp_name;
$tmpfn = tempnam($temp_dir, 'zipmessage');

Loading…
Cancel
Save