summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfellowship_testimonials.module4
-rw-r--r--testimonials_edit.inc21
2 files changed, 16 insertions, 9 deletions
diff --git a/fellowship_testimonials.module b/fellowship_testimonials.module
index ea3b9a2..284d442 100755
--- a/fellowship_testimonials.module
+++ b/fellowship_testimonials.module
@@ -70,7 +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('hidden', '0');
$query->condition('testimonial_type', 'V');
$query->orderBy('year', 'DESC');
//$result = $query->extend('PagerDefault')->limit(3)->execute();
@@ -110,7 +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('hidden', '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 acfed1a..44731c9 100644
--- a/testimonials_edit.inc
+++ b/testimonials_edit.inc
@@ -218,14 +218,14 @@ function fellowship_testimonials_edit_form($form, $form_state, $testimonial_id =
"#type" => "hidden",
"#value" => $testimonial_id
);
- $form["hide"]= array(
+ $form["hidden"]= 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
+ '#title' => t('Do you want to hide the testimonial from the public:'),
+ '#default_value' => $row->hidden
);
$form["submit"] = array(
"#type" => "submit",
@@ -282,7 +282,7 @@ function fellowship_testimonials_edit_form_submit($form, &$form_state) {
'year' => $v['fellowship_year'],
'fellowship_task' => $v['fellowship_task'],
'testimonial_video' => $v['testimonial_video'],
- 'hide' => $v['hide']['value']
+ 'hidden' => $v['hidden']['value']
));
}
@@ -294,7 +294,7 @@ function fellowship_testimonials_edit_form_submit($form, &$form_state) {
'fellowship_task' => $v['fellowship_task'],
'testimonial_text' => $v['testimonial_text']['value'],
'testimonial_text_format' => $v['testimonial_text']['format'],
- 'hide' => $v['hide']['value']
+ 'hidden' => $v['hidden']['value']
));
}
$query->condition('id', $v['testimonial_id']);
@@ -345,7 +345,7 @@ function fellowship_testimonials_edit_all($testimonial_id=0) {
$result = $query->execute();
$headers = array(
- "Name", "Institute", "Activity Name", "Type", "Action"
+ "Name", "Institute", "Activity Name", "Type", "Action", "Status"
);
$rows = array();
@@ -360,6 +360,12 @@ function fellowship_testimonials_edit_all($testimonial_id=0) {
else{
$testimonial_type = "Video";
}
+ if($row->hidden == 1){
+ $display_status = "Hidden to public";
+ }
+ else{
+ $display_status = "Displayed to public";
+ }
/*$speakerquery = db_select('fellows');
$speakerquery->fields('fellows');
$speakerquery->condition('t_id', $row->id);
@@ -374,8 +380,9 @@ function fellowship_testimonials_edit_all($testimonial_id=0) {
$institute,
$row -> activity,
$testimonial_type,
- l("Edit", "internship-experiences/edit/{$row->id}")
+ l("Edit", "internship-experiences/edit/{$row->id}"),
// l("Delete", "fellowship-testimonials/delete/{$row->id}")
+ $display_status
);
array_push($rows, $item);