summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaketh14992021-10-18 14:10:19 +0530
committerSaketh14992021-10-18 14:10:19 +0530
commit9675d3310a868498c7a0e172ebe7ec9b66a9301c (patch)
tree54356f5f7169a34050fbc56d6c5fc83cda69f068
parent7ca1633a11d29c62a0292750222c57bf68541879 (diff)
downloadfellowship_testimonials-9675d3310a868498c7a0e172ebe7ec9b66a9301c.tar.gz
fellowship_testimonials-9675d3310a868498c7a0e172ebe7ec9b66a9301c.tar.bz2
fellowship_testimonials-9675d3310a868498c7a0e172ebe7ec9b66a9301c.zip
Adding hide option to the interface
-rwxr-xr-xfellowship_testimonials.module3
-rw-r--r--testimonials_edit.inc18
2 files changed, 18 insertions, 3 deletions
diff --git a/fellowship_testimonials.module b/fellowship_testimonials.module
index a564de7..ea3b9a2 100755
--- a/fellowship_testimonials.module
+++ b/fellowship_testimonials.module
@@ -45,6 +45,7 @@
"access arguments" => array("manage fellowship_testimonials"),
"type" => MENU_CALLBACK
);
+
return $items;
}
@@ -69,6 +70,7 @@
$result = pager_query($query, 4, 0, "SELECT COUNT(*) FROM fellowship_testimonials");*/
$query = db_select('fellowship_testimonials');
$query->fields('fellowship_testimonials');
+ $query->condition('hide', '0');
$query->condition('testimonial_type', 'V');
$query->orderBy('year', 'DESC');
//$result = $query->extend('PagerDefault')->limit(3)->execute();
@@ -108,6 +110,7 @@
$result = pager_query($query, 4, 0, "SELECT COUNT(*) FROM fellowship_testimonials");*/
$query = db_select('fellowship_testimonials');
$query->fields('fellowship_testimonials');
+ $query->condition('hide', '0');
$query->condition('testimonial_type', 'T');
$query->orderBy('year', 'DESC');
//$result = $query->extend('PagerDefault')->limit(3)->execute();
diff --git a/testimonials_edit.inc b/testimonials_edit.inc
index 5e1f058..cfedd0f 100644
--- a/testimonials_edit.inc
+++ b/testimonials_edit.inc
@@ -218,6 +218,15 @@ function fellowship_testimonials_edit_form($form, $form_state, $testimonial_id =
"#type" => "hidden",
"#value" => $testimonial_id
);
+ $form["hide"]= array(
+ "#type" => "radios",
+ "#options" => array(
+ "1" => "Yes",
+ "0" => "No",
+ ),
+ '#title' => t('Do you want to hide the testimonial from the list:'),
+ '#default_value' => $row->hide
+ );
$form["submit"] = array(
"#type" => "submit",
"#value" => "Submit"
@@ -272,7 +281,8 @@ function fellowship_testimonials_edit_form_submit($form, &$form_state) {
'activity' => $v['activity'],
'year' => $v['fellowship_year'],
'fellowship_task' => $v['fellowship_task'],
- 'testimonial_video' => $v['testimonial_video']
+ 'testimonial_video' => $v['testimonial_video'],
+ 'hide' => $v['hide']['value']
));
}
@@ -283,7 +293,8 @@ function fellowship_testimonials_edit_form_submit($form, &$form_state) {
'year' => $v['fellowship_year'],
'fellowship_task' => $v['fellowship_task'],
'testimonial_text' => $v['testimonial_text']['value'],
- 'testimonial_text_format' => $v['testimonial_text']['format']
+ 'testimonial_text_format' => $v['testimonial_text']['format'],
+ 'hide' => $v['hide']['value']
));
}
$query->condition('id', $v['testimonial_id']);
@@ -364,7 +375,8 @@ function fellowship_testimonials_edit_all($testimonial_id=0) {
$row -> activity,
$testimonial_type,
l("Edit", "internship-experiences/edit/{$row->id}")
- // l("Delete", "fellowship-testimonials/delete/{$row->id}")
+- // l("Delete", "fellowship-testimonials/delete/{$row->id}")
+
);
array_push($rows, $item);
//}