Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F10703809
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
9 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php
index 27887cef3..d2269baba 100644
--- a/plugins/archive/archive.php
+++ b/plugins/archive/archive.php
@@ -1,138 +1,140 @@
<?php
/**
* Archive
*
* Plugin that adds a new button to the mailbox toolbar
* to move messages to a (user selectable) archive folder.
*
* @version 1.4
* @author Andre Rodier, Thomas Bruederli
*/
class archive extends rcube_plugin
{
public $task = 'mail|settings';
function init()
{
+ $rcmail = rcmail::get_instance();
+
+ if (!$rcmail->user->ID)
+ return;
+
$this->register_action('plugin.archive', array($this, 'request_action'));
// There is no "Archived flags"
// $GLOBALS['IMAP_FLAGS']['ARCHIVED'] = 'Archive';
-
- $rcmail = rcmail::get_instance();
if ($rcmail->task == 'mail' && ($rcmail->action == '' || $rcmail->action == 'show')
&& ($archive_folder = $rcmail->config->get('archive_mbox'))) {
-
$skin_path = $this->local_skin_path();
$this->include_script('archive.js');
$this->add_texts('localization', true);
$this->add_button(
array(
'command' => 'plugin.archive',
'imagepas' => $skin_path.'/archive_pas.png',
'imageact' => $skin_path.'/archive_act.png',
'title' => 'buttontitle',
'domain' => $this->ID,
),
'toolbar');
// register hook to localize the archive folder
$this->add_hook('render_mailboxlist', array($this, 'render_mailboxlist'));
// set env variable for client
$rcmail->output->set_env('archive_folder', $archive_folder);
$rcmail->output->set_env('archive_folder_icon', $this->url($skin_path.'/foldericon.png'));
// add archive folder to the list of default mailboxes
if (($default_folders = $rcmail->config->get('default_imap_folders')) && !in_array($archive_folder, $default_folders)) {
$default_folders[] = $archive_folder;
$rcmail->config->set('default_imap_folders', $default_folders);
}
}
else if ($rcmail->task == 'settings') {
$dont_override = $rcmail->config->get('dont_override', array());
if (!in_array('archive_mbox', $dont_override)) {
$this->add_hook('user_preferences', array($this, 'prefs_table'));
$this->add_hook('save_preferences', array($this, 'save_prefs'));
}
}
}
function render_mailboxlist($p)
{
$rcmail = rcmail::get_instance();
$archive_folder = $rcmail->config->get('archive_mbox');
// set localized name for the configured archive folder
if ($archive_folder) {
if (isset($p['list'][$archive_folder]))
$p['list'][$archive_folder]['name'] = $this->gettext('archivefolder');
else // search in subfolders
$this->_mod_folder_name($p['list'], $archive_folder, $this->gettext('archivefolder'));
}
return $p;
}
function _mod_folder_name(&$list, $folder, $new_name)
{
foreach ($list as $idx => $item) {
if ($item['id'] == $folder) {
$list[$idx]['name'] = $new_name;
return true;
} else if (!empty($item['folders']))
if ($this->_mod_folder_name($list[$idx]['folders'], $folder, $new_name))
return true;
}
return false;
}
function request_action()
{
$this->add_texts('localization');
$uids = get_input_value('_uid', RCUBE_INPUT_POST);
$mbox = get_input_value('_mbox', RCUBE_INPUT_POST);
$rcmail = rcmail::get_instance();
// There is no "Archive flags", but I left this line in case it may be useful
// $rcmail->imap->set_flag($uids, 'ARCHIVE');
if (($archive_mbox = $rcmail->config->get('archive_mbox')) && $mbox != $archive_mbox) {
$rcmail->output->command('move_messages', $archive_mbox);
$rcmail->output->command('display_message', $this->gettext('archived'), 'confirmation');
}
$rcmail->output->send();
}
function prefs_table($args)
{
if ($args['section'] == 'folders') {
$this->add_texts('localization');
$rcmail = rcmail::get_instance();
$select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true,
'maxlength' => 30, 'exceptions' => array('INBOX')));
$args['blocks']['main']['options']['archive_mbox'] = array(
'title' => $this->gettext('archivefolder'),
'content' => $select->show($rcmail->config->get('archive_mbox'), array('name' => "_archive_mbox"))
);
}
return $args;
}
function save_prefs($args)
{
if ($args['section'] == 'folders') {
$args['prefs']['archive_mbox'] = get_input_value('_archive_mbox', RCUBE_INPUT_POST);
return $args;
}
}
}
diff --git a/plugins/help/help.php b/plugins/help/help.php
index c02b7e991..94d06542c 100644
--- a/plugins/help/help.php
+++ b/plugins/help/help.php
@@ -1,91 +1,96 @@
<?php
/**
* Help Plugin
*
* @author Aleksander 'A.L.E.C' Machniak
* @licence GNU GPL
*
* Configuration (see config.inc.php.dist)
*
**/
class help extends rcube_plugin
{
function init()
{
+ $rcmail = rcmail::get_instance();
+
+ if (!$rcmail->user->ID)
+ return;
+
$this->add_texts('localization/', false);
// register actions
$this->register_action('plugin.help', array($this, 'action'));
$this->register_action('plugin.helpabout', array($this, 'action'));
$this->register_action('plugin.helplicense', array($this, 'action'));
// add taskbar button
$this->add_button(array(
'name' => 'helptask',
'class' => 'button-help',
'label' => 'help.help',
'href' => './?_task=dummy&_action=plugin.help',
), 'taskbar');
- $skin = rcmail::get_instance()->config->get('skin');
+ $skin = $rcmail->config->get('skin');
if (!file_exists($this->home."/skins/$skin/help.css"))
$skin = 'default';
// add style for taskbar button (must be here) and Help UI
$this->include_stylesheet("skins/$skin/help.css");
}
function action()
{
$rcmail = rcmail::get_instance();
$this->load_config();
// register UI objects
$rcmail->output->add_handlers(array(
'helpcontent' => array($this, 'content'),
));
if ($rcmail->action == 'plugin.helpabout')
$rcmail->output->set_pagetitle($this->gettext('about'));
else if ($rcmail->action == 'plugin.helplicense')
$rcmail->output->set_pagetitle($this->gettext('license'));
else
$rcmail->output->set_pagetitle($this->gettext('help'));
$rcmail->output->send('help.help');
}
function content($attrib)
{
$rcmail = rcmail::get_instance();
if ($rcmail->action == 'plugin.helpabout') {
return @file_get_contents($this->home.'/content/about.html');
}
else if ($rcmail->action == 'plugin.helplicense') {
return @file_get_contents($this->home.'/content/license.html');
}
// default content: iframe
if ($src = $rcmail->config->get('help_source'))
$attrib['src'] = $src;
if (empty($attrib['id']))
$attrib['id'] = 'rcmailhelpcontent';
// allow the following attributes to be added to the <iframe> tag
$attrib_str = create_attrib_string($attrib, array('id', 'class', 'style', 'src', 'width', 'height', 'frameborder'));
$framename = $attrib['id'];
$out = sprintf('<iframe name="%s"%s></iframe>'."\n", $framename, $attrib_str);
return $out;
}
}
?>
diff --git a/plugins/markasjunk/markasjunk.php b/plugins/markasjunk/markasjunk.php
index cf81883fc..9f75590c8 100644
--- a/plugins/markasjunk/markasjunk.php
+++ b/plugins/markasjunk/markasjunk.php
@@ -1,55 +1,59 @@
<?php
/**
* Mark as Junk
*
* Sample plugin that adds a new button to the mailbox toolbar
* to mark the selected messages as Junk and move them to the Junk folder
*
* @version 1.0
* @author Thomas Bruederli
*/
class markasjunk extends rcube_plugin
{
public $task = 'mail';
function init()
{
- $this->register_action('plugin.markasjunk', array($this, 'request_action'));
-
$rcmail = rcmail::get_instance();
+
+ if (!$rcmail->user->ID)
+ return;
+
+ $this->register_action('plugin.markasjunk', array($this, 'request_action'));
+
if ($rcmail->action == '' || $rcmail->action == 'show') {
$skin_path = $this->local_skin_path();
$this->include_script('markasjunk.js');
$this->add_texts('localization', true);
$this->add_button(array(
'command' => 'plugin.markasjunk',
'imagepas' => $skin_path.'/junk_pas.png',
'imageact' => $skin_path.'/junk_act.png',
'title' => 'markasjunk.buttontitle'), 'toolbar');
}
}
function request_action()
{
$this->add_texts('localization');
$GLOBALS['IMAP_FLAGS']['JUNK'] = 'Junk';
$GLOBALS['IMAP_FLAGS']['NONJUNK'] = 'NonJunk';
$uids = get_input_value('_uid', RCUBE_INPUT_POST);
$mbox = get_input_value('_mbox', RCUBE_INPUT_POST);
$rcmail = rcmail::get_instance();
$rcmail->imap->unset_flag($uids, 'NONJUNK');
$rcmail->imap->set_flag($uids, 'JUNK');
if (($junk_mbox = $rcmail->config->get('junk_mbox')) && $mbox != $junk_mbox) {
$rcmail->output->command('move_messages', $junk_mbox);
}
$rcmail->output->command('display_message', $this->gettext('reportedasjunk'), 'confirmation');
$rcmail->output->send();
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Sep 7, 12:02 PM (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1356310
Default Alt Text
(9 KB)
Attached To
Mode
R3 roundcubemail
Attached
Detach File
Event Timeline
Log In to Comment