ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Wiki\Page\ContributorsTableBuilder Class Reference
+ Inheritance diagram for ILIAS\Wiki\Page\ContributorsTableBuilder:
+ Collaboration diagram for ILIAS\Wiki\Page\ContributorsTableBuilder:

Public Member Functions

 __construct (protected InternalDomainService $domain, protected InternalGUIService $gui, protected int $wiki_id, object $parent_gui, string $parent_cmd)
 
- Public Member Functions inherited from ILIAS\Repository\Table\CommonTableBuilder
 __construct (protected object $parent_gui, protected string $parent_cmd, bool $numeric_ids=true)
 
 getTable ()
 

Protected Member Functions

 getId ()
 
 getTitle ()
 
 getRetrieval ()
 
 transformRow (array $data_row)
 transform raw data array to table row data array More...
 
 buildPageListing (array $pages)
 
 getGradingLabel (int $status, ?string $status_date)
 
 build (TableAdapterGUI $table)
 
- Protected Member Functions inherited from ILIAS\Repository\Table\CommonTableBuilder
 getId ()
 
 getTitle ()
 
 getRetrieval ()
 
 getNamespace ()
 
 getOrderingCommand ()
 
 activeAction (string $action, array $data_row)
 
 transformRow (array $data_row)
 transform raw data array to table row data array More...
 
 build (TableAdapterGUI $table)
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\Repository\Table\CommonTableBuilder
TableAdapterGUI $table
 

Detailed Description

Definition at line 30 of file ContributorsTableBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Wiki\Page\ContributorsTableBuilder::__construct ( protected InternalDomainService  $domain,
protected InternalGUIService  $gui,
protected int  $wiki_id,
object  $parent_gui,
string  $parent_cmd 
)

Definition at line 32 of file ContributorsTableBuilder.php.

38 {
39 parent::__construct($parent_gui, $parent_cmd);
40 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ build()

ILIAS\Wiki\Page\ContributorsTableBuilder::build ( TableAdapterGUI  $table)
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 108 of file ContributorsTableBuilder.php.

108 : TableAdapterGUI
109 {
110 $lng = $this->domain->lng();
111
112 return $table
113 ->textColumn("name", $lng->txt("wiki_contributors"), true)
114 ->linkListingColumn("pages", $lng->txt("wiki_page_changes"))
115 ->textColumn("grading", $lng->txt("wiki_grading"))
116 ->textColumn("mark", $lng->txt("wiki_mark"))
117 ->singleAction("editGrading", $lng->txt("wiki_grading"), true)
118 ->singleAction("editMark", $lng->txt("wiki_mark"), true);
119 }
textColumn(string $key, string $title, bool $sortable=false)
global $lng
Definition: privfeed.php:26

References $lng, ILIAS\Repository\Table\CommonTableBuilder\$table, and ILIAS\Repository\Table\TableAdapterGUI\textColumn().

+ Here is the call graph for this function:

◆ buildPageListing()

ILIAS\Wiki\Page\ContributorsTableBuilder::buildPageListing ( array  $pages)
protected

Definition at line 71 of file ContributorsTableBuilder.php.

71 : UnorderedListing
72 {
73 $f = $this->gui->ui()->factory();
74 $items = [];
75 arsort($pages);
76
77 foreach ($pages as $page_id => $count) {
78 if ($page_id > 0) {
79 $link = $f->link()->standard(
80 \ilWikiPage::lookupTitle((int) $page_id) . " (" . $count . ")",
81 ""
82 )->withDisabled();
83 $items[] = $link;
84 }
85 }
86
87 return $f->listing()->unordered($items);
88 }
static lookupTitle(int $a_page_id, string $lang="-")

References Vendor\Package\$f, and ilWikiPage\lookupTitle().

Referenced by ILIAS\Wiki\Page\ContributorsTableBuilder\transformRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGradingLabel()

ILIAS\Wiki\Page\ContributorsTableBuilder::getGradingLabel ( int  $status,
?string  $status_date 
)
protected

Definition at line 90 of file ContributorsTableBuilder.php.

90 : string
91 {
92 $lng = $this->domain->lng();
93 $label = match ($status) {
94 \ilWikiContributor::STATUS_PASSED => $lng->txt("wiki_passed"),
95 \ilWikiContributor::STATUS_FAILED => $lng->txt("wiki_failed"),
96 default => $lng->txt("wiki_notgraded")
97 };
98
99 if ($status_date !== null && $status_date !== "") {
100 $label .= " (" . \ilDatePresentation::formatDate(
101 new \ilDateTime($status_date, IL_CAL_DATETIME)
102 ) . ")";
103 }
104
105 return $label;
106 }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling

References $lng, ilDatePresentation\formatDate(), IL_CAL_DATETIME, ilWikiContributor\STATUS_FAILED, and ilWikiContributor\STATUS_PASSED.

Referenced by ILIAS\Wiki\Page\ContributorsTableBuilder\transformRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ILIAS\Wiki\Page\ContributorsTableBuilder::getId ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 42 of file ContributorsTableBuilder.php.

42 : string
43 {
44 return "wiki_contributors";
45 }

◆ getRetrieval()

ILIAS\Wiki\Page\ContributorsTableBuilder::getRetrieval ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 52 of file ContributorsTableBuilder.php.

52 : RetrievalInterface
53 {
54 return $this->domain->page()->contributorsRetrieval($this->wiki_id);
55 }

◆ getTitle()

ILIAS\Wiki\Page\ContributorsTableBuilder::getTitle ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 47 of file ContributorsTableBuilder.php.

47 : string
48 {
49 return $this->domain->lng()->txt("wiki_contributors");
50 }

◆ transformRow()

ILIAS\Wiki\Page\ContributorsTableBuilder::transformRow ( array  $data_row)
protected

transform raw data array to table row data array

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 57 of file ContributorsTableBuilder.php.

57 : array
58 {
59 return [
60 "id" => $data_row["id"],
61 "name" => $data_row["name"],
62 "pages" => $this->buildPageListing($data_row["pages"]),
63 "grading" => $this->getGradingLabel(
64 $data_row["status"],
65 $data_row["status_date"]
66 ),
67 "mark" => $data_row["mark"]
68 ];
69 }
getGradingLabel(int $status, ?string $status_date)

References ILIAS\Wiki\Page\ContributorsTableBuilder\buildPageListing(), and ILIAS\Wiki\Page\ContributorsTableBuilder\getGradingLabel().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: