Переглянути джерело

added configuration for tripal search block

Lacey Sanderson 9 роки тому
батько
коміт
878cb904e7
1 змінених файлів з 12 додано та 1 видалено
  1. 12 1
      tripal_core/tripal_core.module

+ 12 - 1
tripal_core/tripal_core.module

@@ -788,7 +788,7 @@ function tripal_core_search_block($form, $form_state) {
     '#type' => 'textfield',
     '#size' => 15,
     '#maxlength' => 128,
-    '#attributes' =>array('placeholder' => t('Keywords'))
+    '#attributes' =>array('placeholder' => t(variable_get('tripal_search_placeholder', 'Keywords')))
   );
 
   $form['wrapper']['submit'] = array(
@@ -833,6 +833,13 @@ function tripal_core_block_configure ($delta = '') {
     '#default_value' => variable_get('tripal_search_block_url', 'search/data'),
   );
 
+  $form['search_placeholder'] = array(
+    '#type' => 'textfield',
+    '#title' => 'Placeholder Text',
+    '#description' => 'Change the text that shows up within the search box until the user enters any of their own text.',
+    '#default_value' => variable_get('tripal_search_placeholder', 'Keywords'),
+  );
+
   return $form;
 }
 
@@ -845,4 +852,8 @@ function tripal_core_block_save($delta = '', $edit = array()) {
   if (!empty($edit['search_url'])) {
     variable_set('tripal_search_block_url', $edit['search_url']);
   }
+
+  if (!empty($edit['search_placeholder'])) {
+    variable_set('tripal_search_placeholder', $edit['search_placeholder']);
+  }
 }