9
9
* Interface defining the base operations required to implement a backend.
10
10
*/
11
11
interface BookmarkInterface {
12
+
12
13
/**
13
14
* Adds the specified PID to the given list.
14
15
*
@@ -77,6 +78,7 @@ interface BookmarkInterface {
77
78
* constructed such that it contains a listname and listid for uniqueness.
78
79
*/
79
80
abstract class Bookmark implements BookmarkInterface {
81
+
80
82
/**
81
83
* The name of the object.
82
84
*
@@ -383,12 +385,10 @@ abstract class Bookmark implements BookmarkInterface {
383
385
* theme_tableselect().
384
386
*/
385
387
protected function getTableHeader () {
386
- $ header = array ('markup ' => array ('data ' => t ('Label ' )));;
387
-
388
+ $ header = array ('markup ' => array ('data ' => t ('Label ' )));
388
389
if ($ this ->managementAccess ()) {
389
390
$ header ['remove ' ] = array ('data ' => t ('Operations ' ));
390
391
}
391
-
392
392
return $ header ;
393
393
}
394
394
@@ -414,7 +414,6 @@ abstract class Bookmark implements BookmarkInterface {
414
414
'#button_type ' => 'submit ' ,
415
415
'#pid ' => $ pid ,
416
416
'#value ' => t ('Remove ' ),
417
-
418
417
);
419
418
$ row ['remove ' ] = array (
420
419
'data ' => drupal_render ($ remove_button ),
@@ -472,7 +471,7 @@ abstract class Bookmark implements BookmarkInterface {
472
471
'path ' => drupal_get_path ('module ' , 'islandora_bookmark ' ) . '/images/rss.png ' ,
473
472
'title ' => t ('Present Bookmark list in RSS form ' ),
474
473
'attributes ' => array (),
475
- )), "islandora-bookmark/listid/ $ id/rss " , array ('html ' => TRUE )),
474
+ )), "islandora-bookmark/listid/ $ id/rss " , array ('html ' => TRUE )),
476
475
'#prefix ' => '<div id="islandora-bookmark-rss-format"> ' ,
477
476
'#suffix ' => '</div> ' ,
478
477
);
@@ -492,8 +491,8 @@ abstract class Bookmark implements BookmarkInterface {
492
491
$ form ['bookmarks ' ]['fieldset ' ] += array (
493
492
'table ' => $ table += array (
494
493
'#empty ' => t ('@type list is empty. ' , array (
495
- '@type ' => ucwords (variable_get ('islandora_bookmark_type ' , 'bookmark ' )),
496
- )),
494
+ '@type ' => ucwords (variable_get ('islandora_bookmark_type ' , 'bookmark ' )),
495
+ )),
497
496
'#weight ' => -2 ,
498
497
),
499
498
'pager ' => array (
@@ -668,12 +667,11 @@ abstract class Bookmark implements BookmarkInterface {
668
667
else {
669
668
$ output_user = user_load ($ remove_user )->name ;
670
669
}
671
- drupal_set_message (t ('The user @username has been removed from the list @listname. ' ,
672
- array (
673
- '@listname ' => $ this ->bookmarkName ,
674
- '@username ' => $ output_user ,
675
- )
676
- ));
670
+ drupal_set_message (t ('The user @username has been removed from the list @listname. ' , array (
671
+ '@listname ' => $ this ->bookmarkName ,
672
+ '@username ' => $ output_user ,
673
+ )
674
+ ));
677
675
$ this ->removeUsers (array ($ remove_user ));
678
676
}
679
677
}
@@ -754,11 +752,11 @@ abstract class Bookmark implements BookmarkInterface {
754
752
}
755
753
// Get all users for use in select for forms.
756
754
$ result = db_select ('users ' , 'u ' )
757
- ->fields ('u ' , array ('uid ' , 'name ' ))
758
- ->condition ('STATUS ' , 0 , '!= ' )
759
- ->condition ('uid ' , $ user ->uid , '!= ' )
760
- ->orderBy ('uid ' )
761
- ->execute ();
755
+ ->fields ('u ' , array ('uid ' , 'name ' ))
756
+ ->condition ('STATUS ' , 0 , '!= ' )
757
+ ->condition ('uid ' , $ user ->uid , '!= ' )
758
+ ->orderBy ('uid ' )
759
+ ->execute ();
762
760
763
761
$ options += $ result ->fetchAllAssoc ('uid ' , PDO ::FETCH_ASSOC );
764
762
if (isset ($ options ['0 ' ])) {
@@ -857,8 +855,10 @@ abstract class Bookmark implements BookmarkInterface {
857
855
$ params = array (
858
856
$ pids ,
859
857
);
860
- if (array_key_exists ($ key , $ form_state ['values ' ]['bookmarks ' ]['fieldset ' ]['format_opts ' ]['export_styles ' ])) {
861
- $ params [] = $ form_state ['values ' ]['bookmarks ' ]['fieldset ' ]['format_opts ' ]['export_styles ' ][$ key ];
858
+ if (isset ($ form_state ['values ' ]['bookmarks ' ]['fieldset ' ]['format_opts ' ]['export_styles ' ])) {
859
+ if (array_key_exists ($ key , $ form_state ['values ' ]['bookmarks ' ]['fieldset ' ]['format_opts ' ]['export_styles ' ])) {
860
+ $ params [] = $ form_state ['values ' ]['bookmarks ' ]['fieldset ' ]['format_opts ' ]['export_styles ' ][$ key ];
861
+ }
862
862
}
863
863
call_user_func_array ($ form_state ['islandora_bookmark_export ' ][$ key ], $ params );
864
864
}
@@ -953,9 +953,7 @@ abstract class Bookmark implements BookmarkInterface {
953
953
$ errors = form_get_errors ();
954
954
if (count ($ errors ) === 0 ) {
955
955
$ page = pager_default_initialize (
956
- $ this ->getPidCount (),
957
- variable_get ('islandora_bookmark_detailed_page_elements ' , 10 ),
958
- $ form_state ['islandora_bookmark_pager_element ' ]
956
+ $ this ->getPidCount (), variable_get ('islandora_bookmark_detailed_page_elements ' , 10 ), $ form_state ['islandora_bookmark_pager_element ' ]
959
957
);
960
958
961
959
$ form_state ['redirect ' ] = array (
@@ -981,7 +979,7 @@ abstract class Bookmark implements BookmarkInterface {
981
979
if (!empty ($ broken )) {
982
980
watchdog ('islandora_bookmark ' , 'Broken PIDs encountered: @pids ' , array (
983
981
'@pids ' => implode (', ' , $ broken ),
984
- ), WATCHDOG_WARNING );
982
+ ), WATCHDOG_WARNING );
985
983
}
986
984
987
985
return $ functional ;
@@ -997,9 +995,10 @@ abstract class Bookmark implements BookmarkInterface {
997
995
if (!empty ($ broken )) {
998
996
watchdog ('islandora_bookmark ' , 'Broken PIDs encountered: @pids ' , array (
999
997
'@pids ' => implode (', ' , $ broken ),
1000
- ), WATCHDOG_WARNING );
998
+ ), WATCHDOG_WARNING );
1001
999
}
1002
1000
1003
1001
return $ functional ;
1004
1002
}
1003
+
1005
1004
}
0 commit comments