Author Topic: Check box plugin  (Read 20656 times)

Offline umount

  • Full Member
  • ***
  • Posts: 63
Check box plugin
« on: December 10, 2010, 07:20:00 AM »
I want to present to you new roundcube plugin  chbox.
checkbox to select messages.

https://github.com/umount/rcplugin_chbox

It is testing version, need patching list.js file, but soon I will be corrected and I will let out the normal version without a patch.

Also my plugin bounce was still updated. Now it support auto loading.
https://github.com/umount/rcplugin_bounce
« Last Edit: December 13, 2010, 08:27:22 AM by umount »

Offline umount

  • Full Member
  • ***
  • Posts: 63
Check box plugin
« Reply #1 on: December 13, 2010, 07:12:08 AM »
Remove list.patch. Now plugin chbox work without patch, only how plugin roundcube.

Comments and suggestions are welcome.

Offline lacri

  • Full Member
  • ***
  • Posts: 179
    • http://www.php-lexikon.de
Check box plugin
« Reply #2 on: December 13, 2010, 08:29:02 AM »
nice :)

you forgott localizations (chbox.chbox) and a the patch for
the functions.js to initialise the selectmenu

in skins/default/functions.js search forfunction rcube_mail_ui()
{
  
this.popups = {
and add selectmenu:       {id:'selectmenu'},and for localizations add folder localization in chbox plugin directory
and add File e.G. for german de_DE.inc with this Content
<?php

$labels 
= array();
$labels['chbox'] = 'Checkbox';

?>


Many thanks for this plugin and your work.

Offline lacri

  • Full Member
  • ***
  • Posts: 179
    • http://www.php-lexikon.de
Check box plugin
« Reply #3 on: December 13, 2010, 08:42:29 AM »
rosali has a plugin msglistcols with a small modification in msglistcols.php you can add the chbox plugin to this.

search in msglistcols.php tofor($i=0;$i<9;$i++){
          
$field_id 'rcmfd_list_col' $i;
and add $select_col->add(rcube_label('chbox','msglistcols'), 'chbox');a better way is:
@rosali add a check if chbox plugin is loaded :)

and add localization string for chbox in msglistcols localization files
$labels['chbox'] = "Checkbox";
« Last Edit: December 13, 2010, 08:45:07 AM by lacri »

Offline umount

  • Full Member
  • ***
  • Posts: 63
Check box plugin
« Reply #4 on: December 13, 2010, 09:40:54 AM »
Quote from: lacri;31754
nice :)

you forgott localizations (chbox.chbox) and a the patch for
the functions.js to initialise the selectmenu

in skins/default/functions.js search forfunction rcube_mail_ui()
{
  
this.popups = {
and add selectmenu:       {id:'selectmenu'},and for localizations add folder localization in chbox plugin directory
and add File e.G. for german de_DE.inc with this Content
<?php

$labels 
= array();
$labels['chbox'] = 'Checkbox';

?>


Many thanks for this plugin and your work.


I am sorry have forgotten to add folder localization.

patch for skins/default/functions.js I'm try fix :), for it I forgotten too

Offline lacri

  • Full Member
  • ***
  • Posts: 179
    • http://www.php-lexikon.de
Check box plugin
« Reply #5 on: December 13, 2010, 01:57:44 PM »
i found another small Bug
i have on the bottom as last message in the messagelist one message without subject and 0 bytes sice this one wrong message comes not from imap and has no id she is generated by the chbox plugin or caused by the plugin.

i search for a solution tomorrow morning now is evening :)

many greetz :)

Offline lacri

  • Full Member
  • ***
  • Posts: 179
    • http://www.php-lexikon.de
Check box plugin
« Reply #6 on: December 14, 2010, 04:15:56 AM »
the bug is in chbox.php in the message_list function
search
function message_list($args){
    
$count count($args['messages']);
    for (
$i=0;$i<$count;$i++) {
      
$uid $args['messages'][$i]->uid;
      
$args['messages'][$i]->list_cols['chbox'] = '<input type="checkbox" name="rcmselect'.$uid.'" id="rcmselect'.$uid.'" />';
    }
    return 
$args;
  }

and replace with
function message_list($args){
    
$count count($args['messages'])-1;
    for (
$i=0;$i<$count;$i++) {
      
$uid $args['messages'][$i]->uid;
      
$args['messages'][$i]->list_cols['chbox'] = '<input type="checkbox" name="rcmselect'.$uid.'" id="rcmselect'.$uid.'" />';
    }
    return 
$args;
  }

the issue is the wrong count of messages
i have change only the count with -1
$count count($args['messages'])-1;

I hope this helps :)

Offline lacri

  • Full Member
  • ***
  • Posts: 179
    • http://www.php-lexikon.de
Check box plugin
« Reply #7 on: December 14, 2010, 05:02:07 AM »
refix the first fix dont work when folder is empty here is a better solution works fine when folder contains one or more messages and when folder is empty :)

replace message_list function in chbox.php withfunction message_list($args){
    
$count count($args['messages']);
      for (
$i=0;$i<$count;$i++) {
          
$uid $args['messages'][$i]->uid;
        if(
$uid != NULL) {
            
$args['messages'][$i]->list_cols['chbox'] = '<input type="checkbox" name="rcmselect'.$uid.'" id="rcmselect'.$uid.'" />';
        }
      }
    return 
$args;
  }

Offline umount

  • Full Member
  • ***
  • Posts: 63
Check box plugin
« Reply #8 on: December 14, 2010, 05:11:44 AM »
Quote from: lacri;31761
the bug is in chbox.php in the message_list function
search
function message_list($args){
    
$count count($args['messages']);
    for (
$i=0;$i<$count;$i++) {
      
$uid $args['messages'][$i]->uid;
      
$args['messages'][$i]->list_cols['chbox'] = '<input type="checkbox" name="rcmselect'.$uid.'" id="rcmselect'.$uid.'" />';
    }
    return 
$args;
  }

and replace with
function message_list($args){
    
$count count($args['messages'])-1;
    for (
$i=0;$i<$count;$i++) {
      
$uid $args['messages'][$i]->uid;
      
$args['messages'][$i]->list_cols['chbox'] = '<input type="checkbox" name="rcmselect'.$uid.'" id="rcmselect'.$uid.'" />';
    }
    return 
$args;
  }

the issue is the wrong count of messages
i have change only the count with -1
$count count($args['messages'])-1;

I hope this helps :)


Thank you for help.

Offline lacri

  • Full Member
  • ***
  • Posts: 179
    • http://www.php-lexikon.de
Check box plugin
« Reply #9 on: December 14, 2010, 05:24:31 AM »
i have seen in github you have commited my first fix :) this contains a little bug use the fix from my last posting :)

thanks for your plugin ;)

Offline umount

  • Full Member
  • ***
  • Posts: 63
Check box plugin
« Reply #10 on: December 14, 2010, 05:31:33 AM »
Quote from: lacri;31764
i have seen in github you have commited my first fix :) this contains a little bug use the fix from my last posting :)

thanks for your plugin ;)


no problem :)

Offline umount

  • Full Member
  • ***
  • Posts: 63
Check box plugin
« Reply #11 on: December 14, 2010, 08:16:22 AM »
Remove need patch functions.js

Offline umount

  • Full Member
  • ***
  • Posts: 63
Check box plugin
« Reply #12 on: December 15, 2010, 03:11:51 AM »
If you need select childs of collapsed rows.

You should uncomment 45 line

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Check box plugin
« Reply #13 on: December 31, 2010, 11:06:08 AM »
Please make css skinable:

chbox.php :: line 22


    $this
->include_stylesheet($this->local_skin_path() . "/chbox.css");
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Check box plugin
« Reply #14 on: December 31, 2010, 01:42:57 PM »
Please move ...

chbox_menu

... function out of event listener. It reduces the time to replace the chbox label.

chbox.js

if (window.rcmail) {
  
chbox_menu();
  
rcmail.addEventListener('init', function(evt) {
    
rcmail.register_command('plugin.chbox.selectmenu'rcmail_selectmenutrue);
Regards,
Rosali
__________________
MyRoundcube Project (commercial)