Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion FieldtypePageTableExtended.module
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
<?php namespace ProcessWire;

class FieldtypePageTableExtended extends FieldtypePageTable {

public static function getModuleInfo() {
Expand Down
Empty file modified InputfieldPageTableExtended.css
100644 → 100755
Empty file.
Empty file modified InputfieldPageTableExtended.js
100644 → 100755
Empty file.
21 changes: 11 additions & 10 deletions InputfieldPageTableExtended.module
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php namespace ProcessWire;

class InputfieldPageTableExtended extends InputfieldPageTable {

Expand Down Expand Up @@ -40,26 +40,27 @@ class InputfieldPageTableExtended extends InputfieldPageTable {
public function ___renderTable(array $columns) {
// exit($this->pathToTemplates);
if($this->renderLayout) {
$files = $this->wire('files');
$pagesToRender = $this->attr('value'); // pages
$layout = "";
//get the right language label
$lang = wire('user')->language;
$label = 'label';
if (wire('user')->language->title != 'default'){
$label = "label{$lang}";
if ($this->wire('modules')->isInstalled('LanguageSupport') && $this->wire('user')->language->name != 'default'){
$label = "label{$this->wire('user')->language}";
}
// $this->wire("config")->paths->templates .= "views/bocks/";
// echo $this->wire("config")->paths->templates;
foreach($pagesToRender as $p){
$layoutTitle = $p->template->$label ? $p->template->$label : $p->template->name;
$ext = "." . $this->config->templateExtension;
$template_name = $p->template->altFilename ? basename($p->template->altFilename, $ext) : $p->template->name;
$templateFilename = $this->config->paths->templates . $this->pathToTemplates . $template_name . $ext;
if(is_dir($this->pathToTemplates)) $templateFilename = $this->config->paths->templates . $this->pathToTemplates . $template_name . $ext;
else $templateFilename = $this->pathToTemplates;
if(preg_match('/\{(.*?)\}/', $templateFilename, $_match) && $this->config->paths->{$_match[1]}) {
$templateFilename = $this->config->paths->{$_match[1]} . str_replace($_match[0], '', $this->pathToTemplates);
}
$parsedTemplate = $files->render($templateFilename, array('page' => $p, 'isAdmin' => 1, 'pageTableExtended' => true));

$parsedTemplate = new TemplateFile($templateFilename);
$parsedTemplate->set("page", $p);
$parsedTemplate->set("isAdmin", 1);
$parsedTemplate->options = array('pageTableExtended' => true);
$p->of(true);

$iconClass = "fa-angle-down";
Expand All @@ -82,7 +83,7 @@ class InputfieldPageTableExtended extends InputfieldPageTable {
<i class="toggle-icon fa '.$iconClass.'"></i>
</a>
<span class="renderedLayoutTitle '.$activeClass.'">'.$layoutTitle.'</span>
<div class="renderedLayout '.$activeClass.$statusClass.'">'.$parsedTemplate->render().'</div>
<div class="renderedLayout '.$activeClass.$statusClass.'">' . $parsedTemplate . '</div>
</td>
<td width="5%">
<a class="InputfieldPageTableEdit" data-url="./?id='.$p->id.'&amp;modal=1" href="#">
Expand Down
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified resetAdminCSS.css
100644 → 100755
Empty file.