63 $query = sprintf(
"SELECT * FROM survey_phrase WHERE defaultvalue = '1' OR owner_fi = %s ORDER BY title",
64 $ilDB->quote($ilUser->getId())
67 while ($row =
$result->fetchRow(MDB2_FETCHMODE_OBJECT))
69 if (($row->defaultvalue == 1) and ($row->owner_fi == 0))
73 $phrases[$row->phrase_id] = array(
74 "title" => $lng->txt($row->title),
75 "owner" => $row->owner_fi
81 if ($ilUser->getId() == $row->owner_fi)
83 $phrases[$row->phrase_id] = array(
84 "title" => $row->title,
85 "owner" => $row->owner_fi
107 $categories = array();
108 $query = sprintf(
"SELECT survey_category.* FROM survey_category, survey_phrase_category WHERE survey_phrase_category.category_fi = survey_category.category_id AND survey_phrase_category.phrase_fi = %s ORDER BY survey_phrase_category.sequence",
109 $ilDB->quote($phrase_id)
111 $result = $ilDB->query($query);
112 while ($row = $result->fetchRow(MDB2_FETCHMODE_OBJECT))
114 if (($row->defaultvalue == 1) and ($row->owner_fi == 0))
116 $categories[$row->category_id] = $lng->txt($row->title);
120 $categories[$row->category_id] = $row->title;
138 if ((is_array($phrase_array)) && (count($phrase_array)))
140 $query =
"DELETE FROM survey_phrase WHERE phrase_id IN ('" . join($phrase_array,
"','") .
"')";
141 $result = $ilDB->query($query);
142 $query =
"DELETE FROM survey_phrase_category WHERE phrase_fi IN ('" . join($phrase_array,
"','") .
"')";
143 $result = $ilDB->query($query);