From 9ef68f741a6f47af7a1a350958387c2479295f97 Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Fri, 10 Jul 2020 13:11:13 +0530 Subject: Update form to add text testimonials, display tab structure for text and video --- fellowship_testimonials.module | 90 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 6 deletions(-) (limited to 'fellowship_testimonials.module') diff --git a/fellowship_testimonials.module b/fellowship_testimonials.module index 862f570..9424e8f 100755 --- a/fellowship_testimonials.module +++ b/fellowship_testimonials.module @@ -1,11 +1,29 @@ "Testimonials by FOSSEE Summer Fellows", "page callback" => "fellowship_testimonials_display_all", "access arguments" => array("view fellowship_testimonials"), "type" => MENU_CALLBACK + );*/ + $items["fellowship-testimonials"] = array( + "title" => "Fellowship testimonials", + "page callback" => "drupal_get_form", + "page arguments" => array( + "fellowship_testimonials_display_form" + ), + "access arguments" => array( + "view fellowship_testimonials" + ), + "type" => MENU_NORMAL_ITEM + ); + $items["fellowship-testimonials/year-wise"] = array( + "title" => "Testimonials by FOSSEE Summer Fellows year wise", + "page callback" => "fellowship_testimonials_display_year_wise", + "access arguments" => array("view fellowship_testimonials"), + "type" => MENU_CALLBACK, + 'file' => 'testimonials_year_wise.inc' ); $items["fellowship-testimonials/add"] = array( "title" => "Add fellowship testimonials", @@ -19,7 +37,7 @@ "page callback" => "fellowship_testimonials_edit_all", "access arguments" => array("manage fellowship_testimonials"), "type" => MENU_CALLBACK, - 'file' => 'testimonials_add.inc' + 'file' => 'testimonials_edit.inc' ); $items["fellowship-testimonials/delete"] = array( "title" => "Delete Testimonial", @@ -42,7 +60,7 @@ ), ); } - function fellowship_testimonials_display_all() { + function get_video_testimonials() { $page_content = ""; /*$query = " SELECT * FROM fellowship_testimonials @@ -51,9 +69,10 @@ $result = pager_query($query, 4, 0, "SELECT COUNT(*) FROM fellowship_testimonials");*/ $query = db_select('fellowship_testimonials'); $query->fields('fellowship_testimonials'); + $query->condition('testimonial_type', 'V'); $query->orderBy('year', 'DESC'); - $result = $query->extend('PagerDefault')->limit(3)->execute(); - + //$result = $query->extend('PagerDefault')->limit(3)->execute(); + $result = $query->execute(); $page_content .= "
{$row->testimonial_text}
"; + //while($speakerrow = $speakerresult->fetchObject()){ + $page_content .= "{$speakerrow->name}
{$speakerrow->institute}, {$speakerrow->place}
";
+ // }
+ $page_content .= "{$row->fellowship_task}
+
{$row->year}