Lines Matching refs:this

100      * These can be overriden by plugins using this class
104 $this->style = $this->getConf('style'); //string
105 $this->showheader = $this->getConf('showheader'); //on-off
106 $this->showfirsthl = $this->getConf('showfirsthl'); //on-off
107 $this->sort = $this->getConf('sort'); //on-off
108 $this->rsort = $this->getConf('rsort'); //on-off
109 $this->sortKey = $this->getConf('sortby'); //string
110 if($this->sortKey) {
111 $this->sort = true;
114 $this->plugins = [
121 $this->column = [
123 'date' => $this->getConf('showdate'), //0,1,2
124 'user' => $this->getConf('showuser'), //0,1,2,3,4
125 'desc' => $this->getConf('showdesc'), //0,160,500
127 'comments' => $this->getConf('showcomments'), //on-off
128 'linkbacks' => $this->getConf('showlinkbacks'), //on-off
129 'tags' => $this->getConf('showtags'), //on-off
130 'image' => $this->getConf('showimage'), //on-off
131 'diff' => $this->getConf('showdiff'), //on-off
134 $this->header = [];
135 $this->limit = 0;
203 if (!isset($this->plugins[$plugin]) || !in_array($col, $this->plugins[$plugin])) {
204 $this->plugins[$plugin][] = $col;
206 $this->column[$col] = true;
218 if (isset($this->column[$col])) {
219 $this->column[$col] = $value;
233 $this->header = $header;
256 $this->style = 'default';
259 $this->style = 'table';
262 $this->style = 'list';
265 $this->style = 'simplelist'; // Displays pagenames only, no other information
268 $this->showheader = true;
271 $this->showheader = false;
274 $this->showfirsthl = true;
277 $this->showfirsthl = false;
280 $this->sort = true; //sort by pageid
281 $this->rsort = false;
284 $this->sort = true; //reverse sort on key, not sure if that is by pageid
285 $this->rsort = true;
288 $this->sort = false;
289 $this->rsort = false;
299 $this->sortKey = substr($flag, 7);
300 $this->sort = true;
304 $this->defaultSortKey = substr($flag, 14);
307 $this->limit = (int) substr($flag, 6);
318 if (isset($this->column[$flag]) && $flag !== 'page') {
319 $this->column[$flag] = $value;
322 if ($this->sortKey === '' && $this->sort) {
323 $this->sortKey = $this->defaultSortKey;
338 switch ($this->style) {
357 $this->doc = '<div class="table"><table class="' . $class . '">';
360 $this->showheader = false;
361 $this->showfirsthl = false;
363 $this->doc = '<ul>';
366 $this->page = null;
367 $this->pages = [];
370 foreach ($this->plugins as $plugin => $columns) {
372 if (!$this->column[$col]) continue;
374 if (!$this->$plugin = $this->loadHelper($plugin)) {
375 $this->column[$col] = false;
381 if ($this->showheader) {
382 $this->doc .= '<tr>';
385 if ($this->column['image']) {
386 if (empty($this->header['image'])) {
387 $this->header['image'] = hsc($this->pageimage->th('image'));
389 $this->doc .= '<th class="images">' . $this->header['image'] . '</th>';
393 if ($this->column[$col]) {
394 if (empty($this->header[$col])) {
395 $this->header[$col] = hsc($this->getLang($col));
397 $this->doc .= '<th class="' . $col . '">' . $this->header[$col] . '</th>';
401 foreach ($this->plugins as $plugin => $columns) {
403 if ($this->column[$col] && $col != 'image') {
404 if (empty($this->header[$col])) {
405 $this->header[$col] = hsc($this->$plugin->th($col, $class));
407 $this->doc .= '<th class="' . $col . '">' . $this->header[$col] . '</th>';
411 $this->doc .= '</tr>';
421 * 'title' => string First headline, otherwise page id; exception: if titleimage is used this is used for the image title&alt attribute
442 $this->page = $page;
443 $this->meta = null; // do all metadata calls in addPage()
445 if ($this->style != 'simplelist') {
446 if (!isset($this->page['draft'])) {
447 $this->page['draft'] = $this->getMeta('type') == 'draft';
449 $this->getPageData($id);
451 if (!empty($this->column['date'])) {
452 $this->getDate();
454 if (!empty($this->column['user'])) {
455 $this->getUser();
457 if (!empty($this->column['desc'])) {
458 $this->getDescription();
460 if (!empty($this->column['summary'])) {
461 $this->getSummary();
465 $sortKey = $this->getSortKey($id);
468 $sortKey = $this->uniqueKey($sortKey, $this->pages);
469 $this->pages[$sortKey] = $this->page;
471 $this->pages[] = $this->page;
515 $this->page = $page;
516 $this->meta = null; // should not be used here
518 $id = $this->page['id'];
519 if ($this->style == 'simplelist') {
521 $this->doc .= '<li>';
528 if (empty($this->page['title'])) {
529 $this->page['title'] = str_replace('_', ' ', noNS($id));
531 $title = hsc($this->page['title']);
534 $this->doc .= $content;
535 $this->doc .= '</li>';
542 if (isset($this->page['priority'])) {
543 $class .= 'priority' . $this->page['priority'] . ' ';
545 if (!empty($this->page['draft'])) {
548 if (!empty($this->page['class'])) {
549 $class .= $this->page['class'];
556 $this->doc .= '<tr' . $class . '>';
558 if (!empty($this->column['image'])) {
559 $this->printPluginCell('pageimage', 'image', $id);
561 $this->printPageCell($id);
563 if (!empty($this->column['date'])) {
564 $this->printDateCell();
566 if (!empty($this->column['user'])) {
567 $this->printUserCell();
569 if (!empty($this->column['desc'])) {
570 $this->printDescriptionCell();
572 if (!empty($this->column['diff'])) {
573 $this->printDiffCell($id);
575 if (!empty($this->column['summary'])) {
576 $this->printSummary();
578 foreach ($this->plugins as $plugin => $columns) {
580 if (!empty($this->column[$col]) && $col != 'image') {
581 $this->printPluginCell($plugin, $col, $id);
585 $this->doc .= '</tr>';
596 if ($this->sort) {
597 Sort::ksort($this->pages);
598 if ($this->rsort) {
599 $this->pages = array_reverse($this->pages, true);
604 foreach ($this->pages as $page) {
605 $this->renderPageRow($page);
608 if($this->limit > 0 && $cnt >= $this->limit){
613 if ($this->style == 'simplelist') {
614 $this->doc .= '</ul>';
616 if (!isset($this->page)) {
617 $this->doc = '';
619 $this->doc .= '</table></div>';
624 $this->__construct();
626 return $this->doc;
634 * @param string $id page id displayed in this table row
639 if ($this->page['exists']) {
646 if (!empty($this->page['titleimage'])) {
647 $title = '<img src="' . ml($this->page['titleimage']) . '" class="media"';
648 if (!empty($this->page['title'])) {
649 $title .= ' title="' . hsc($this->page['title']) . '" alt="' . hsc($this->page['title']) . '"';
653 $title = hsc($this->page['title']);
657 $section = !empty($this->page['section']) ? '#' . $this->page['section'] : '';
659 if ($this->style == 'list') {
662 return $this->printCell('page', $content);
674 if (empty($this->page['date']) || empty($this->page['exists'])) {
675 return $this->printCell('date', '');
677 return $this->printCell('date', dformat($this->page['date'], $conf['dformat']));
688 return $this->printCell('user', $this->page['user']);
714 $desc = $this->page['desc'];
716 $max = $this->column['desc'];
720 return $this->printCell('desc', hsc($desc));
726 * @param string $id page id displayed in this table row
732 if (!isset($this->page['exists'])) {
733 if (!isset($this->page['file'])) {
734 $this->page['file'] = wikiFN($id);
736 $this->page['exists'] = @file_exists($this->page['file']);
742 $url = wl($id, $url_params) . (!empty($this->page['section']) ? '#' . $this->page['section'] : '');
745 title="' . hsc($this->getLang('diff_title')) . '" alt="' . hsc($this->getLang('diff_alt')) . '"/>
747 return $this->printCell('diff', $content);
755 return $this->printCell('summary', hsc($this->page['summary']));
763 * @param string $id page id displayed in this table row
768 if (!isset($this->page[$col])) {
769 $this->page[$col] = $this->$plugin->td($id, $col);
771 return $this->printCell($col, $this->page[$col]);
789 $this->doc .= '<td class="' . $class . '">' . $content . '</td>';
803 if (empty($this->page['exists']) || empty($this->page['id'])) {
806 if (!isset($this->meta)) {
807 $this->meta = p_get_metadata($this->page['id'], '', METADATA_RENDER_USING_CACHE);
811 return $this->meta[$key] ?? null;
813 return $this->meta[$key][$subkey] ?? null;
825 if (!isset($this->page['exists'])) {
826 if (!isset($this->page['file'])) {
827 $this->page['file'] = wikiFN($id);
829 $this->page['exists'] = @file_exists($this->page['file']);
832 if (empty($this->page['titleimage'])) {
834 if (blank($this->page['title']) && $this->showfirsthl) {
835 $this->page['title'] = $this->getMeta('title');
838 if (blank($this->page['title'])) {
839 $this->page['title'] = str_replace('_', ' ', noNSorNS($id));
849 if (array_key_exists('desc', $this->page)) return;
851 if (strlen($this->page['description']) > 0) {
854 $desc = $this->page['description'];
857 $desc = $this->getMeta('plugin_description', 'keywords');
861 $desc = $this->getMeta('description', 'abstract');
867 $this->page['desc'] = $desc;
872 if (array_key_exists('summary', $this->page)) return;
874 $summary = $this->getMeta('last_change', 'sum');
875 $this->page['summary'] = $summary;
882 if (array_key_exists('user', $this->page)) return;
885 switch ($this->column['user']) {
887 $content = $this->getMeta('creator');
891 $users = $this->getMeta('contributor');
898 $content = $this->getShowUserAsContent($this->getMeta('user'));
901 $users = $this->getMeta('contributor');
907 $content .= $this->getShowUserAsContent($userid);
915 $this->page['user'] = $content;
923 if (empty($this->page['date']) && !empty($this->page['exists'])) {
924 if ($this->column['date'] == 2) {
925 $this->page['date'] = $this->getMeta('date', 'modified');
927 $this->page['date'] = $this->getMeta('date', 'created');
941 if ($this->sortKey !== '') {
942 $sortKey = $this->page[$this->sortKey] ?? false;
945 if ($this->sortKey == "draft") {
946 $this->page['draft'] = $this->getMeta('type') == 'draft';
948 $this->getPageData($id);
949 if ($this->sortKey == "pagename") {
950 $this->page['pagename'] = noNS($id);
952 if ($this->sortKey == "ns") {
961 $this->page['ns'] = str_replace(':', "\0", $sortkey);
963 if ($this->sortKey == "date") {
964 $this->getDate();
966 if ($this->sortKey == "desc") {
967 $this->getDescription();
969 if ($this->sortKey == "summary") {
970 $this->getSummary();
972 if ($this->sortKey == "user") {
973 $this->getUser();
975 foreach ($this->plugins as $plugin => $columns) {
977 if ($this->sortKey == $col) {
978 if (!isset($this->page[$col])) {
979 $this->page[$col] = $this->$plugin->td($id, $col);
984 $sortKey = $this->page[$this->sortKey] ?? 9999999999999999; //TODO mostly used for non-existing pages. 999 works only for dates?