本文整理汇总了PHP中rcube::get_instance方法的典型用法代码示例。如果您正苦于以下问题:PHP rcube::get_instance方法的具体用法?PHP rcube::get_instance怎么用?PHP rcube::get_instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rcube
的用法示例。
在下文中一共展示了rcube::get_instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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'));
}
}
}
}
示例2: 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);
}
示例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);
}
示例4: test_constructor
/**
* Plugin object construction test
*/
function test_constructor()
{
$rcube = rcube::get_instance();
$plugin = new identity_select($rcube->api);
$this->assertInstanceOf('identity_select', $plugin);
$this->assertInstanceOf('rcube_plugin', $plugin);
}
示例5: __construct
/**
* Constructor
*
* @param string $lang Language code
*/
function __construct($lang = 'en')
{
$this->rc = rcube::get_instance();
$this->engine = $this->rc->config->get('spellcheck_engine', 'googie');
$this->lang = $lang ? $lang : 'en';
$this->options = array('ignore_syms' => $this->rc->config->get('spellcheck_ignore_syms'), 'ignore_nums' => $this->rc->config->get('spellcheck_ignore_nums'), 'ignore_caps' => $this->rc->config->get('spellcheck_ignore_caps'), 'dictionary' => $this->rc->config->get('spellcheck_dictionary'));
}
示例6: 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);
}
示例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);
}
示例8: 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);
}
示例9: 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;
}
}
示例10: 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);
}
示例11: 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);
}
示例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);
}
}
}
示例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'));
}
示例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();
}
}
}
}
示例15: 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);
}