19 declare(strict_types=1);
41 $DIC->resourceStorage()->collection()->id()
48 $this->filtered_amount_of_items = (
int) $this->db->fetchAssoc(
$r)[
'cnt'];
53 while (
$d = $this->db->fetchAssoc(
$r)) {
54 $rid_strings[] =
$d[
'rid'] ??
'';
56 $this->irss->preload($rid_strings);
57 foreach ($rid_strings as $rid_string) {
58 $rid_instance = $this->irss->manage()->find($rid_string);
62 $this->collection->add($rid_instance);
87 $r = $this->db->query(
'SELECT DISTINCT * FROM il_resource_stkh');
88 while (
$d = $this->db->fetchAssoc(
$r)) {
89 $class_name =
$d[
'class_name'] ??
'';
90 if (!class_exists($class_name)) {
94 $stakeholder =
new $class_name();
96 $stakeholders[
$d[
'id']] = $stakeholder->getConsumerNameForPresentation();
102 'title' => $ui_factory->
input()->field()->text(
105 'size' => $ui_factory->
input()->field()->numeric(
106 $lng->
txt(
'file_size_bigger_than')
108 'stakeholder' => $ui_factory->
input()->field()->select(
109 $lng->
txt(
'stakeholders'),
135 $q .=
" FROM il_resource_revision 136 JOIN il_resource_info ON il_resource_revision.rid = il_resource_info.rid AND 137 il_resource_info.version_number = il_resource_revision.version_number 138 JOIN il_resource_stkh_u ON il_resource_revision.rid = il_resource_stkh_u.rid";
144 $q .=
" GROUP BY il_resource_revision.rid ";
166 return "SELECT COUNT(il_resource_revision.rid) AS cnt";
169 return "SELECT il_resource_revision.rid 170 , MAX(il_resource_revision.version_number) AS max_revision 171 , il_resource_revision.title AS revision_title 172 , il_resource_info.title AS file_title 173 , il_resource_info.size AS file_size 174 , il_resource_info.creation_date AS creation_date 175 , il_resource_stkh_u.stakeholder_id AS stakeholder";
183 if ($this->filter_values !==
null) {
184 if (isset($this->filter_values[
'title']) && $this->filter_values[
'title'] !==
'') {
185 $filter_values[] = $this->db->quote(
"%" . $this->filter_values[
'title'] .
"%",
'text');
186 $filters[] =
" il_resource_revision.title LIKE %s ";
188 if (isset($this->filter_values[
'size']) && $this->filter_values[
'size'] !==
'') {
191 $filters[] =
" il_resource_info.size > %s ";
194 if (isset($this->filter_values[
'stakeholder']) && $this->filter_values[
'stakeholder'] !==
'') {
195 $filter_values[] = $this->db->quote(
"" . $this->filter_values[
'stakeholder'] .
"",
'text');
196 $filters[] =
" il_resource_stkh_u.stakeholder_id = %s ";
199 if ($filters !== []) {
200 $query =
" WHERE " . implode(
" AND ", $filters);
211 if ($this->filter_values !==
null && (isset($this->filter_values[
'revisions']) && $this->filter_values[
'revisions'] !==
'')) {
212 $filter_values[] = $this->db->quote($this->filter_values[
'revisions'],
'integer');
213 $filters[] =
"MAX(il_resource_revision.version_number) > %s ";
215 if ($filters !== []) {
216 $query =
" HAVING " . implode(
" AND ", $filters);
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
input()
description: purpose: > In opposite to components with a purely receptive or at most navigational ch...
const BY_CREATION_DATE_DESC
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
buildSelect(bool $count_only)
This is how the factory for UI elements looks.
getFilterItems(Factory $ui_factory, \ilLanguage $lng)
Class ResourceIdentification.
const BY_CREATION_DATE_ASC
__construct(Container $dic, ilPlugin $plugin)
getBaseQuery(bool $count_only)