56 $result = $ilDB->queryF(
"SELECT * FROM svy_phrase WHERE defaultvalue = %s OR owner_fi = %s ORDER BY title",
57 array(
'text',
'integer'),
58 array(
'1', $ilUser->getId())
62 if ((
$row->defaultvalue == 1) and (
$row->owner_fi == 0))
66 $phrases[
$row->phrase_id] = array(
67 "title" => $lng->txt(
$row->title),
68 "owner" =>
$row->owner_fi
74 if ($ilUser->getId() ==
$row->owner_fi)
76 $phrases[
$row->phrase_id] = array(
77 "title" =>
$row->title,
78 "owner" =>
$row->owner_fi
97 $categories = array();
98 $result = $ilDB->queryF(
"SELECT svy_category.* FROM svy_category, svy_phrase_cat WHERE svy_phrase_cat.category_fi = svy_category.category_id AND svy_phrase_cat.phrase_fi = %s ORDER BY svy_phrase_cat.sequence",
104 if ((
$row->defaultvalue == 1) and (
$row->owner_fi == 0))
106 $categories[
$row->category_id] = $lng->txt(
$row->title);
110 $categories[
$row->category_id] =
$row->title;
125 if ((is_array($phrase_array)) && (count($phrase_array)))
127 $affectedRows = $ilDB->manipulate(
"DELETE FROM svy_phrase WHERE " . $ilDB->in(
'phrase_id', $phrase_array,
false,
'integer'));
128 $affectedRows = $ilDB->manipulate(
"DELETE FROM svy_phrase_cat WHERE " . $ilDB->in(
'phrase_fi', $phrase_array,
false,
'integer'));