Skip to content

Commit 2582aa7

Browse files
committed
Merge branch '7.x' of github.com:Islandora/islandora_bookmark into 7.x
Conflicts: README.md
2 parents 011f665 + 1b1ac7c commit 2582aa7

File tree

5 files changed

+33
-37
lines changed

5 files changed

+33
-37
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ Install as usual, see [this](https://drupal.org/documentation/install/modules-th
2424

2525
## Configuration
2626

27-
Configure general bookmark settings in Administration » Islandora » Bookmark (admin/islandora/islandora_bookmark).
28-
29-
![Configuration](http://i.imgur.com/xFqF471.png)
27+
Configure general bookmark settings in Administration » Islandora » Islandora Utility Modules » Bookmark (admin/islandora/tools/islandora-bookmark).
3028

29+
![Configuration](https://camo.githubusercontent.com/e851eaa47d5ba712ff7e8579a91dd6da2b38ae64/687474703a2f2f692e696d6775722e636f6d2f7664747444534d2e706e67)
3130

3231
Enable 'Bookmark' in Administration » Islandora » Solr index » Solr Settings (admin/islandora/search/islandora_solr/settings).
3332

includes/bookmark.inc

+24-25
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Interface defining the base operations required to implement a backend.
1010
*/
1111
interface BookmarkInterface {
12+
1213
/**
1314
* Adds the specified PID to the given list.
1415
*
@@ -77,6 +78,7 @@ interface BookmarkInterface {
7778
* constructed such that it contains a listname and listid for uniqueness.
7879
*/
7980
abstract class Bookmark implements BookmarkInterface {
81+
8082
/**
8183
* The name of the object.
8284
*
@@ -383,12 +385,10 @@ abstract class Bookmark implements BookmarkInterface {
383385
* theme_tableselect().
384386
*/
385387
protected function getTableHeader() {
386-
$header = array('markup' => array('data' => t('Label')));;
387-
388+
$header = array('markup' => array('data' => t('Label')));
388389
if ($this->managementAccess()) {
389390
$header['remove'] = array('data' => t('Operations'));
390391
}
391-
392392
return $header;
393393
}
394394

@@ -414,7 +414,6 @@ abstract class Bookmark implements BookmarkInterface {
414414
'#button_type' => 'submit',
415415
'#pid' => $pid,
416416
'#value' => t('Remove'),
417-
418417
);
419418
$row['remove'] = array(
420419
'data' => drupal_render($remove_button),
@@ -472,7 +471,7 @@ abstract class Bookmark implements BookmarkInterface {
472471
'path' => drupal_get_path('module', 'islandora_bookmark') . '/images/rss.png',
473472
'title' => t('Present Bookmark list in RSS form'),
474473
'attributes' => array(),
475-
)), "islandora-bookmark/listid/$id/rss", array('html' => TRUE)),
474+
)), "islandora-bookmark/listid/$id/rss", array('html' => TRUE)),
476475
'#prefix' => '<div id="islandora-bookmark-rss-format">',
477476
'#suffix' => '</div>',
478477
);
@@ -492,8 +491,8 @@ abstract class Bookmark implements BookmarkInterface {
492491
$form['bookmarks']['fieldset'] += array(
493492
'table' => $table += array(
494493
'#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+
)),
497496
'#weight' => -2,
498497
),
499498
'pager' => array(
@@ -668,12 +667,11 @@ abstract class Bookmark implements BookmarkInterface {
668667
else {
669668
$output_user = user_load($remove_user)->name;
670669
}
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+
));
677675
$this->removeUsers(array($remove_user));
678676
}
679677
}
@@ -754,11 +752,11 @@ abstract class Bookmark implements BookmarkInterface {
754752
}
755753
// Get all users for use in select for forms.
756754
$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();
762760

763761
$options += $result->fetchAllAssoc('uid', PDO::FETCH_ASSOC);
764762
if (isset($options['0'])) {
@@ -857,8 +855,10 @@ abstract class Bookmark implements BookmarkInterface {
857855
$params = array(
858856
$pids,
859857
);
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+
}
862862
}
863863
call_user_func_array($form_state['islandora_bookmark_export'][$key], $params);
864864
}
@@ -953,9 +953,7 @@ abstract class Bookmark implements BookmarkInterface {
953953
$errors = form_get_errors();
954954
if (count($errors) === 0) {
955955
$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']
959957
);
960958

961959
$form_state['redirect'] = array(
@@ -981,7 +979,7 @@ abstract class Bookmark implements BookmarkInterface {
981979
if (!empty($broken)) {
982980
watchdog('islandora_bookmark', 'Broken PIDs encountered: @pids', array(
983981
'@pids' => implode(', ', $broken),
984-
), WATCHDOG_WARNING);
982+
), WATCHDOG_WARNING);
985983
}
986984

987985
return $functional;
@@ -997,9 +995,10 @@ abstract class Bookmark implements BookmarkInterface {
997995
if (!empty($broken)) {
998996
watchdog('islandora_bookmark', 'Broken PIDs encountered: @pids', array(
999997
'@pids' => implode(', ', $broken),
1000-
), WATCHDOG_WARNING);
998+
), WATCHDOG_WARNING);
1001999
}
10021000

10031001
return $functional;
10041002
}
1003+
10051004
}

includes/solr_results.inc

+4-6
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,8 @@ class IslandoraSolrResultsBookmark extends IslandoraSolrResults {
5353
* An array containing form structure.
5454
*/
5555
public function formGet($form, &$form_state, $object_results) {
56-
$form_state['islandora_solr_query_processor'] = $this->islandoraSolrQueryProcessor;
5756
module_load_include('inc', 'islandora_bookmark', 'includes/api');
58-
59-
form_load_include($form_state, 'inc', 'islandora_bookmark', 'IslandoraSolrResultsBookmark');
57+
$form_state['islandora_solr_query_processor'] = $this->islandoraSolrQueryProcessor;
6058

6159
if (module_exists('citation_exporter')) {
6260
if (CitationExporter::ReadyToExport()) {
@@ -116,10 +114,10 @@ class IslandoraSolrResultsBookmark extends IslandoraSolrResults {
116114
*/
117115
protected function getTableRow($object_result) {
118116
$doc = $object_result['solr_doc'];
119-
117+
$solr_field = variable_get('islandora_solr_object_label_field', 'fgs_label_s');
120118
$markup = '';
121-
if (isset($doc['object_label'])) {
122-
$markup = $doc['object_label'];
119+
if (isset($doc[$solr_field])) {
120+
$markup = $doc[$solr_field];
123121
}
124122
else {
125123
$markup = $object_result['PID'];

islandora_bookmark.info

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name = Islandora Bookmark
22
description = Allows users to build, manage and track lists of PIDs.
33
dependencies[] = islandora
4-
package = Islandora
5-
configure = admin/islandora/islandora-bookmark
4+
package = Islandora Tools
5+
configure = admin/islandora/tools/islandora-bookmark
66
version = 7.x-dev
77
core = 7.x
88
files[] = includes/bookmark.inc

islandora_bookmark.module

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function islandora_bookmark_menu() {
6868
'access arguments' => array(2),
6969
'type' => MENU_CALLBACK,
7070
);
71-
$items['admin/islandora/islandora-bookmark'] = array(
71+
$items['admin/islandora/tools/islandora-bookmark'] = array(
7272
'title' => 'Bookmark',
7373
'description' => 'Configure settings for the Bookmark module.',
7474
'page callback' => 'drupal_get_form',

0 commit comments

Comments
 (0)