2
2
/**
3
3
* Roundcube Bookmarks Plugin
4
4
*
5
- * @version 2.2.1
5
+ * @version 2.2.2
6
6
* @author Offerel
7
7
* @copyright Copyright (c) 2020, Offerel
8
8
* @license GNU General Public License, version 3
9
9
*/
10
10
class syncmarks extends rcube_plugin
11
- {
12
- public $ task = '?(?!login|logout ).* ' ;
11
+ {
12
+ public $ task = '?(?!login).* ' ;
13
13
14
14
public function init () {
15
15
$ rcmail = rcmail::get_instance ();
16
+ $ this ->load_config ();
16
17
$ this ->add_texts ('localization/ ' , true );
17
18
$ this ->register_task ('syncmarks ' );
18
19
$ this ->include_stylesheet ($ this ->local_skin_path ().'/plugin.css ' );
@@ -54,13 +55,17 @@ function bms_preferences_list($p) {
54
55
if ($ p ['section ' ] != 'syncmarks ' ) {
55
56
return $ p ;
56
57
}
58
+
57
59
$ rcmail = rcmail::get_instance ();
58
60
$ p ['blocks ' ]['main ' ]['name ' ]=$ this ->gettext ('mainoptions ' );
59
61
$ field_id ='bms_notifications ' ;
60
62
$ input = new html_checkbox (array ( 'name ' => 'bms_notifications ' ,
61
63
'onchange ' => 'en_noti() ' ,
62
64
'id ' => 'bms_notifications ' ,
63
65
'value ' => 1 ));
66
+
67
+ $ p ['blocks ' ]['main ' ]['options ' ]['bms_noti ' ] = array ('title ' => html::label ($ field_id , $ this ->gettext ('bookmarks_not ' )),
68
+ 'content ' => $ input ->show (intval ($ rcmail ->config ->get ('bms_notifications ' ))));
64
69
return $ p ;
65
70
}
66
71
@@ -80,8 +85,8 @@ function unset_cookie() {
80
85
81
86
function get_notifications () {
82
87
$ rcmail = rcmail::get_instance ();
88
+ $ this ->load_config ();
83
89
if ($ _COOKIE ['sycmarks_n ' ] != '1 ' && $ rcmail ->config ->get ('bms_notifications ' ) == "1 " ) {
84
- //$this->load_config();
85
90
$ path = $ rcmail ->config ->get ('bookmarks_path ' , false );
86
91
$ filename = $ rcmail ->config ->get ('bookmarks_filename ' , false );
87
92
@@ -288,6 +293,7 @@ function get_title($url) {
288
293
289
294
function add_url () {
290
295
$ rcmail = rcmail::get_instance ();
296
+ $ this ->load_config ();
291
297
$ new_url = rcube_utils::get_input_value ('_url ' , rcube_utils::INPUT_POST );
292
298
$ format = rcube_utils::get_input_value ('_format ' , rcube_utils::INPUT_POST );
293
299
$ path = $ rcmail ->config ->get ('bookmarks_path ' , false );
@@ -387,11 +393,11 @@ function add_url() {
387
393
388
394
function add_bookmarks () {
389
395
$ rcmail = rcmail::get_instance ();
390
- $ this ->include_script ('syncmarks.js ' );
391
396
$ exctasks = array ("login " ,"logout " );
392
397
393
398
if (!in_array ($ rcmail ->task ,$ exctasks )) {
394
399
$ this ->load_config ();
400
+ $ this ->include_script ('syncmarks.js ' );
395
401
$ filename = $ rcmail ->config ->get ('bookmarks_filename ' , false );
396
402
$ ext = pathinfo ($ filename , PATHINFO_EXTENSION );
397
403
$ rcmail ->output ->add_footer ("<div id= \"bookmarkpane \"></div> " );
@@ -450,7 +456,6 @@ function makeHTMLTree($arr) {
450
456
}
451
457
452
458
function parseHTMLMarks ($ bookmarks , $ bdate , $ button , $ format ='html ' ) {
453
- $ rcmail = rcmail::get_instance ();
454
459
$ bookmarks = preg_replace ("/<DD>[^>]*?</i " , "< " , $ bookmarks );
455
460
$ bookmarks = preg_replace ("/<DT><H3 [^>]*? PERSONAL_TOOLBAR_FOLDER= \"true \">(.+?)<\/H3>/is " , "</ol><H1>$1</H1> " , $ bookmarks );
456
461
$ bookmarks = preg_replace ("/<DT><H3 [^>]*? UNFILED_BOOKMARKS_FOLDER= \"true \">(.+?)<\/H3>/is " , "<H1>$1</H1> " , $ bookmarks );
0 commit comments