本文整理汇总了PHP中rcube类的典型用法代码示例。如果您正苦于以下问题:PHP rcube类的具体用法?PHP rcube怎么用?PHP rcube使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了rcube类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* __construct
*
* Provide a uid, and parse message structure.
*
* @param string $uid The message UID.
* @param string $folder Folder name
*
* @see self::$app, self::$storage, self::$opt, self::$parts
*/
function __construct($uid, $folder = null)
{
$this->uid = $uid;
$this->app = rcube::get_instance();
$this->storage = $this->app->get_storage();
$this->folder = strlen($folder) ? $folder : $this->storage->get_folder();
$this->storage->set_options(array('all_headers' => true));
// Set current folder
$this->storage->set_folder($this->folder);
$this->headers = $this->storage->get_message($uid);
if (!$this->headers) {
return;
}
$this->mime = new rcube_mime($this->headers->charset);
$this->subject = $this->mime->decode_mime_string($this->headers->subject);
list(, $this->sender) = each($this->mime->decode_address_list($this->headers->from, 1));
$this->set_safe(intval($_GET['_safe']) || $_SESSION['safe_messages'][$uid]);
$this->opt = array('safe' => $this->is_safe, 'prefer_html' => $this->app->config->get('prefer_html'), 'get_url' => $this->app->url(array('action' => 'get', 'mbox' => $this->storage->get_folder(), 'uid' => $uid)));
if (!empty($this->headers->structure)) {
$this->get_mime_numbers($this->headers->structure);
$this->parse_structure($this->headers->structure);
} else {
$this->body = $this->storage->get_body($uid);
}
// notify plugins and let them analyze this structured message object
$this->app->plugins->exec_hook('message_load', array('object' => $this));
}
开发者ID:rockchow2002,项目名称:roundcubemail,代码行数:37,代码来源:rcube_message.php
示例2: _do_filterlearn
private function _do_filterlearn($uids, $spam)
{
$rcmail = rcube::get_instance();
$user = $rcmail->user;
foreach ($uids as $uid) {
$MESSAGE = new rcube_message($uid);
$from = $MESSAGE->sender['mailto'];
if ($from == "") {
$rcmail->output->command('display_message', 'email address not found ' . $from, 'error');
} else {
$new_arr['whatfilter'] = 'from';
$new_arr['searchstring'] = htmlspecialchars(addslashes($from));
$new_arr['destfolder'] = addslashes("Junk");
$new_arr['messages'] = 'all';
$new_arr['filterpriority'] = '';
$new_arr['markread'] = 'markread';
$arr_prefs = $user->get_prefs();
$arr_prefs['filters'][] = $new_arr;
if ($user->save_prefs($arr_prefs)) {
$rcmail->output->command('display_message', 'I learned that messages from ' . $from . ' are SPAM', 'confirmation');
} else {
$rcmail->output->command('display_message', 'I learned nothing', 'error');
}
}
}
}
开发者ID:RavenB,项目名称:filter_learn,代码行数:26,代码来源:filter_learn.php
示例3: test_constructor
/**
* Plugin object construction test
*/
function test_constructor()
{
$rcube = rcube::get_instance();
$plugin = new database_attachments($rcube->api);
$this->assertInstanceOf('database_attachments', $plugin);
$this->assertInstanceOf('rcube_plugin', $plugin);
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:10,代码来源:DatabaseAttachments.php
示例4: test_constructor
/**
* Plugin object construction test
*/
function test_constructor()
{
$rcube = rcube::get_instance();
$plugin = new help($rcube->api);
$this->assertInstanceOf('help', $plugin);
$this->assertInstanceOf('rcube_plugin', $plugin);
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:10,代码来源:Help.php
示例5: html_output
/**
* This callback function adds a box below the message content
* if there is a vcard attachment available
*/
function html_output($p)
{
$attach_script = false;
foreach ($this->vcard_parts as $part) {
$vcards = rcube_vcard::import($this->message->get_part_content($part, null, true));
// successfully parsed vcards?
if (empty($vcards)) {
continue;
}
// remove part's body
if (in_array($part, $this->vcard_bodies)) {
$p['content'] = '';
}
foreach ($vcards as $idx => $vcard) {
// skip invalid vCards
if (empty($vcard->email) || empty($vcard->email[0])) {
continue;
}
$display = $vcard->displayname . ' <' . $vcard->email[0] . '>';
// add box below message body
$p['content'] .= html::p(array('class' => 'vcardattachment'), html::a(array('href' => "#", 'onclick' => "return plugin_vcard_save_contact('" . rcube::JQ($part . ':' . $idx) . "')", 'title' => $this->gettext('addvcardmsg')), html::span(null, rcube::Q($display))));
}
$attach_script = true;
}
if ($attach_script) {
$this->include_script('vcardattach.js');
$this->include_stylesheet($this->local_skin_path() . '/style.css');
}
return $p;
}
开发者ID:bbspike,项目名称:sentora-core,代码行数:34,代码来源:vcard_attachments.php
示例6: mailto_callback
/**
* Callback function used to build mailto: links around e-mail strings
*
* This also adds an onclick-handler to open the Rouncube compose message screen on such links
*
* @param array Matches result from preg_replace_callback
* @return int Index of saved string value
* @see rcube_string_replacer::mailto_callback()
*/
public function mailto_callback($matches)
{
$href = $matches[1];
$suffix = $this->parse_url_brackets($href);
$i = $this->add(html::a(array('href' => 'mailto:' . $href, 'onclick' => "return " . rcmail_output::JS_OBJECT_NAME . ".command('compose','" . rcube::JQ($href) . "',this)"), rcube::Q($href)) . $suffix);
return $i >= 0 ? $this->get_replacement($i) : '';
}
开发者ID:noikiy,项目名称:roundcubemail,代码行数:16,代码来源:rcmail_string_replacer.php
示例7: test_constructor
/**
* Plugin object construction test
*/
function test_constructor()
{
$rcube = rcube::get_instance();
$plugin = new new_user_dialog($rcube->api);
$this->assertInstanceOf('new_user_dialog', $plugin);
$this->assertInstanceOf('rcube_plugin', $plugin);
}
开发者ID:rcg2015,项目名称:roundcubemail,代码行数:10,代码来源:NewUserDialog.php
示例8: test_constructor
/**
* Plugin object construction test
*/
function test_constructor()
{
$rcube = rcube::get_instance();
$plugin = new additional_message_headers($rcube->api);
$this->assertInstanceOf('additional_message_headers', $plugin);
$this->assertInstanceOf('rcube_plugin', $plugin);
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:10,代码来源:AdditionalMessageHeaders.php
示例9: test_constructor
/**
* Plugin object construction test
*/
function test_constructor()
{
$rcube = rcube::get_instance();
$plugin = new example_addressbook($rcube->api);
$this->assertInstanceOf('example_addressbook', $plugin);
$this->assertInstanceOf('rcube_plugin', $plugin);
}
开发者ID:rcg2015,项目名称:roundcubemail,代码行数:10,代码来源:ExampleAddressbook.php
示例10: test_constructor
/**
* Plugin object construction test
*/
function test_constructor()
{
$rcube = rcube::get_instance();
$plugin = new debug_logger($rcube->api);
$this->assertInstanceOf('debug_logger', $plugin);
$this->assertInstanceOf('rcube_plugin', $plugin);
}
开发者ID:JotapePinheiro,项目名称:roundcubemail,代码行数:10,代码来源:DebugLogger.php
示例11: test_constructor
/**
* Plugin object construction test
*/
function test_constructor()
{
$rcube = rcube::get_instance();
$plugin = new newmail_notifier($rcube->api);
$this->assertInstanceOf('newmail_notifier', $plugin);
$this->assertInstanceOf('rcube_plugin', $plugin);
}
开发者ID:rcg2015,项目名称:roundcubemail,代码行数:10,代码来源:NewmailNotifier.php
示例12: import
/**
*
*/
public function import($csv)
{
// convert to UTF-8
$head = substr($csv, 0, 4096);
$fallback = rcube::get_instance()->config->get('default_charset', 'ISO-8859-1');
// fallback to Latin-1?
$charset = rcube_charset::detect($head, RCUBE_CHARSET);
$csv = rcube_charset::convert($csv, $charset);
$head = '';
$this->map = array();
// Parse file
foreach (preg_split("/[\r\n]+/", $csv) as $i => $line) {
$elements = $this->parse_line($line);
if (empty($elements)) {
continue;
}
// Parse header
if (empty($this->map)) {
$this->parse_header($elements);
if (empty($this->map)) {
break;
}
} else {
$this->csv_to_vcard($elements);
}
}
}
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:30,代码来源:rcube_csv2vcard.php
示例13: init
function init()
{
$this->rc = rcube::get_instance();
$this->add_hook('authenticate', array($this, 'authentication'));
$this->add_hook('storage_connect', array($this, 'storage_connection'));
$this->add_hook('smtp_connect', array($this, 'smtp_connection'));
}
开发者ID:fetlock,项目名称:roundcube-plugin-runbox-authentication,代码行数:7,代码来源:runbox_authentication.php
示例14: init
function init()
{
$this->rc = rcube::get_instance();
// register actions
$this->register_action('plugin.managesieve', array($this, 'managesieve_actions'));
$this->register_action('plugin.managesieve-action', array($this, 'managesieve_actions'));
$this->register_action('plugin.managesieve-vacation', array($this, 'managesieve_actions'));
$this->register_action('plugin.managesieve-save', array($this, 'managesieve_save'));
$this->register_action('plugin.managesieve-saveraw', array($this, 'managesieve_saveraw'));
if ($this->rc->task == 'settings') {
$this->add_hook('settings_actions', array($this, 'settings_actions'));
$this->init_ui();
} else {
if ($this->rc->task == 'mail') {
// register message hook
if ($this->rc->action == 'show') {
$this->add_hook('message_headers_output', array($this, 'mail_headers'));
}
// inject Create Filter popup stuff
if (empty($this->rc->action) || $this->rc->action == 'show' || strpos($this->rc->action, 'plugin.managesieve') === 0) {
$this->mail_task_handler();
}
}
}
}
开发者ID:jimjag,项目名称:roundcubemail,代码行数:25,代码来源:managesieve.php
示例15: init
function init()
{
$this->add_texts('localization/');
$this->register_action('plugin.archive', array($this, 'request_action'));
$rcmail = rcube::get_instance();
if ($rcmail->task == 'mail' && ($rcmail->action == '' || $rcmail->action == 'show') && ($archive_folder = $rcmail->config->get('archive_mbox'))) {
$this->add_hook('render_mailboxlist', array($this, 'render_mailboxlist'));
if ($rcmail->config->get('archive_show_button', true)) {
$this->add_button(array('type' => 'link', 'label' => 'buttontitle', 'command' => 'plugin.archive', 'class' => 'button buttonPas archive disabled', 'classact' => 'button archive', 'width' => 32, 'height' => 32, 'title' => 'buttontitle', 'domain' => $this->ID), 'toolbar');
}
$rcmail->output->set_env('archive_folder', $archive_folder);
if ($rcmail->config->get('skin', 'larry') == 'classic') {
$this->include_stylesheet('skins/classic/archivefolder.css');
}
} else {
if ($rcmail->task == 'settings') {
$dont_override = $rcmail->config->get('dont_override', array());
if (!in_array('archive_mbox', $dont_override)) {
$this->add_hook('preferences_sections_list', array($this, 'archivefoldersection'));
$this->add_hook('preferences_list', array($this, 'prefs_table'));
$this->add_hook('preferences_save', array($this, 'save_prefs'));
}
}
}
}
开发者ID:MetallianFR68,项目名称:myroundcube,代码行数:25,代码来源:archivefolder.php
示例16: test_constructor
/**
* Plugin object construction test
*/
function test_constructor()
{
$rcube = rcube::get_instance();
$plugin = new subscriptions_option($rcube->api);
$this->assertInstanceOf('subscriptions_option', $plugin);
$this->assertInstanceOf('rcube_plugin', $plugin);
}
开发者ID:rcg2015,项目名称:roundcubemail,代码行数:10,代码来源:SubscriptionsOption.php
示例17: test_constructor
/**
* Plugin object construction test
*/
function test_constructor()
{
$rcube = rcube::get_instance();
$plugin = new virtuser_file($rcube->api);
$this->assertInstanceOf('virtuser_file', $plugin);
$this->assertInstanceOf('rcube_plugin', $plugin);
}
开发者ID:rcg2015,项目名称:roundcubemail,代码行数:10,代码来源:VirtuserFile.php
示例18: ham
public function ham(&$uids, $mbox)
{
$rcmail = rcube::get_instance();
$storage = $rcmail->storage;
$new_uids = array();
foreach ($uids as $uid) {
$saved = false;
$message = new rcube_message($uid);
if (sizeof($message->attachments) > 0) {
foreach ($message->attachments as $part) {
if ($part->ctype_primary == 'message' && $part->ctype_secondary == 'rfc822' && $part->ctype_parameters['x-spam-type'] == 'original') {
$orig_message_raw = $message->get_part_body($part->mime_id);
$saved = $storage->save_message($mbox, $orig_message_raw);
if ($saved !== false) {
$rcmail->output->command('rcmail_markasjunk2_move', null, $uid);
array_push($new_uids, $saved);
}
}
}
}
}
if (sizeof($new_uids) > 0) {
$uids = $new_uids;
}
}
开发者ID:nciftci,项目名称:plugins,代码行数:25,代码来源:sa_detach.php
示例19: test_constructor
/**
* Plugin object construction test
*/
function test_constructor()
{
$rcube = rcube::get_instance();
$plugin = new squirrelmail_usercopy($rcube->api);
$this->assertInstanceOf('squirrelmail_usercopy', $plugin);
$this->assertInstanceOf('rcube_plugin', $plugin);
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:10,代码来源:SquirrelmailUsercopy.php
示例20: test_constructor
/**
* Plugin object construction test
*/
function test_constructor()
{
$rcube = rcube::get_instance();
$plugin = new hide_blockquote($rcube->api);
$this->assertInstanceOf('hide_blockquote', $plugin);
$this->assertInstanceOf('rcube_plugin', $plugin);
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:10,代码来源:HideBlockquote.php
注:本文中的rcube类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论