Преглед изворни кода

Issue #72: Updating API to include 2.1 improvements: 878cb90

Stephen Ficklin пре 7 година
родитељ
комит
aedf6a52d7
1 измењених фајлова са 11 додато и 1 уклоњено
  1. 11 1
      legacy/tripal_core/tripal_core.module

+ 11 - 1
legacy/tripal_core/tripal_core.module

@@ -330,7 +330,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(
@@ -340,6 +340,13 @@ function tripal_core_search_block($form, $form_state) {
     '#suffix' => '</div>'
   );
 
+  $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;
 }
 
@@ -387,4 +394,7 @@ 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']);
+  }
 }