Dateiverwaltung: Spalten und Schaltflächen anpassen

11. Dez 2025

Die Dateiverwaltung in Weblication ® können Sie individuell anpassen. Dies gilt für die Anzeige von Spalten und die Einblendung von funktionalen Buttons auf Projekt- und Verzeichnis-Ebene.

Hierzu rufen Sie als Administrator in der Dateiverwaltung die Projekteinstellungen bzw. die Verzeichniseinstellungen auf und klicken auf "Projektspezifische Spaltendarstellung und Schaltflächen erstellen". Danach können Sie die Spaltendarstellung sowie die angezeigten Schaltflächen anpassen.

Beispiel:

  • Einblendung Button "Personalisierung", um direkt in der Dateiverwaltung die Einstellungen für die Personalisierung vorzunehmen. Benutzern werden dadurch mehrere Klicks in den Einstellungen erspart.

Details

Beispiel für das Einblenden von Buttons

Buttons "Meine Schaltfläche" und "Personalisierung" anzeigen

Buttons "Meine Schaltfläche" und "Personalisierung" werden eingeblendet
Buttons "Meine Schaltfläche" und "Personalisierung" werden eingeblendet

Spalten im Verzeichnis Veranstaltungen im Veranstaltungskalender

Spalten im Verzeichnis Veranstaltungen im Veranstaltungskalender
Spalten im Verzeichnis Veranstaltungen im Veranstaltungskalender

So bereiten Sie das Verzeichnis für die individuelle Darstellung in der Dateiverwaltung vor

So bereiten Sie das Verzeichnis für die individuelle Darstellung in der Dateiverwaltung vor
So bereiten Sie das Verzeichnis für die individuelle Darstellung in der Dateiverwaltung vor

So passen Sie die Darstellung in der Dateiverwaltung an

So passen Sie die Darstellung in der Dateiverwaltung an
So passen Sie die Darstellung in der Dateiverwaltung an

Im vorbereiteten Code nehmen Sie die gewünschten Anpassungen vor

Im vorbereiteten Code nehmen Sie die gewünschten Anpassungen vor
Im vorbereiteten Code nehmen Sie die gewünschten Anpassungen vor
Im vorbereiteten Code nehmen Sie die gewünschten Anpassungen vor
Im vorbereiteten Code nehmen Sie die gewünschten Anpassungen vor

Codebeispiel

<?php

  /*
  In dieser Konfigurationsdatei können Sie die Spalten des Dateiexplorers individuell anpassen.
  */

  $matches = array();

  if(preg_match('/\/wGlobal\/mastertemplates\/(item|component)/', $scriptData['path'], $matches)){

    $elementType = $matches[1];

    $orderByDefault   = "/wd:extension/wd:meta/wd:sorting/@value";
    $orderDirDefault  = "asc";

    if($elementType == 'component'){
      $columnsToHide    = array('filenameX', 'size', 'title', 'mtime');
    }
    else{
      $columnsToHide    = array('size');
    }

    $additionalData   = array();
    //if($elementType == 'item'){
      $additionalData[] = array('caption' => 'Sortier-ID', 'width' => '72', 'align' => 'left', 'orderBy' => "/wd:extension/wd:meta/wd:sorting/@value", 'callback' => function($documentPath){
        $sortingValue   = wDocumentData::getData($documentPath, "/wd:extension/wd:meta/wd:sorting/@value");

        $viewableStr = '';

        $viewableStr .= '<input class="wui-input" style="width:60px;min-height:auto;height:17px;box-sizing:border-box;-moz-box-sizing:border-box;padding:0 4px" onclick="wEditorEmbed.showMaskEditField(\''.$documentPath.'\', \'sortingValue\', this.parentNode)" value="'.$sortingValue.'" />';

        return $viewableStr;
      });
    //}

    $additionalData[] = array('caption' => 'Nutzbar durch', 'width' => '120', 'align' => 'left', 'orderBy' => "/wd:extension/wd:object/wd:data[@id = 'price']/text()", 'callback' => function($documentPath){
      $viewUsers   = wDocumentData::getViewUsers($documentPath);
      $viewGroups  = wDocumentData::getViewGroups($documentPath);
      $viewDataStr = '';

      foreach($viewUsers as $viewUser){
        $viewDataStr .= ' u:'.$viewUser;
      }

      foreach($viewGroups as $viewGroup){
        $viewDataStr .= ' g:'.$viewGroup;
      }

      $viewableStr = '';

      $viewableStr .= '<select class="wui-select" style="font-size:11px" onclick="event.preventDefault();event.stopPropagation()" ondblclick="event.preventDefault();event.stopPropagation()" onchange="wFilemanager.setPersonalizationDocument(\''.$documentPath.'\', this.options[this.selectedIndex].value);">';
      if(count($viewUsers) == 0 && count($viewGroups) == 0){
        $viewableStr .= '<option selected="selected">Alle</option>';
        $viewableStr .= '<option value="g:chiefeditorship">Chefredakteure</option>';
        $viewableStr .= '<option value="g:administrators">Administratoren</option>';
      }
      else if($viewDataStr == ' u:admin' || $viewDataStr == ' g:administrators'){
        $viewableStr .= '<option>Alle</option>';
        $viewableStr .= '<option value="g:chiefeditorship">Chefredakteure</option>';
        $viewableStr .= '<option value="g:administrators"selected="selected">Administratoren</option>';
      }
      else if($viewDataStr == ' g:chiefeditorship'){
        $viewableStr .= '<option>Alle</option>';
        $viewableStr .= '<option value="g:chiefeditorship" selected="selected">Chefredakteure</option>';
        $viewableStr .= '<option value="g:administrators">Administratoren</option>';
      }
      else{
        $viewableStr .= '<option>'.$viewDataStr.'</option>';
        $viewableStr .= '<option>Alle</option>';
        $viewableStr .= '<option value="g:chiefeditorship">Chefredakteure</option>';
        $viewableStr .= '<option value="g:administrators">Administratoren</option>';
      }
      $viewableStr .= '</select>';

      return $viewableStr;
    });


    if(preg_match('/\/wGlobal\/mastertemplates\/components$/', $scriptData['path'], $matches)){
      $additionalData[] = array('caption' => 'Einfügbar in', 'width' => '', 'align' => 'left', 'callback' => function($documentPath){

        $contentGroupsStr = '';

        $nodesContentGroup = wDocumentData::getNodes($documentPath, '/wd:extension/wd:mastertemplate/wd:contentGroup');
        foreach($nodesContentGroup as $nodeContentGroup){
          $contentGroupsStr .= $nodeContentGroup->getAttribute('name').'<br />';
        }

        return $contentGroupsStr;
      });
    }

    if(preg_match('/\/wGlobal\/mastertemplates\/items$/', $scriptData['path'], $matches)){
      $additionalData[] = array('caption' => '', 'width' => '24', 'align' => 'left', 'callback' => function($documentPath){

        $viewableStr = '';

        $hasToAddElement = wDocumentData::getData($documentPath, '/wd:extension/wd:mastertemplate/@hasToAddElement');
        if($hasToAddElement == '1'){
          $viewableStr = '<span style="margin:6px 0 0 4px;display:block;width:8px;height:8px;border-radius:4px;cursor:pointer;background-color:orange;font-weight:bold" title="Klicken Sie hier, um fehlende Elemente (z.B. wd:fragment) zu ergänzen, damit diese nicht bei jedem Einfügen im Editor hinzugefügt werden müssen." onclick="wOpenWin(\'/weblication/grid5/apps/wEditorWd8/index.php?action=completefragments&path='.$documentPath.'\')"></span>';
        }

        return $viewableStr;
      });
    }
  }
  else if(preg_match('/\/wGlobal\/layout\/templates\/objects$/', $scriptData['path'], $matches)){

    $columnsToHide    = array('size');

    $additionalButtons   = array();

    $isMfb = wRepository::documentExists(wPathName::getDirTop($scriptData['path']).'/wGlobal/layout/styles/page.scss');

    if($isMfb){
      //$additionalButtons[] = array('id' => 'createDocument', 'icon' => 'createDocument', 'caption' => 'Objekt-Template erstellen', 'onclick' => 'wFilemanager.showMaskCreateFile()');
      //$additionalButtons[] = array('id' => 'objectmanager', 'icon' => 'edit', 'caption' => 'Objektverwaltung', 'onclick' => 'wFilemanager.toggleMask(\'/weblication/grid5/scripts/wProjectmanager.php?action=showObjectManager&project='.wPathName::getDirTop($scriptData['path']).'&display=blank\', {\'buttonMark\' : this})');
      $additionalButtons[] = array('id' => 'objectmanager', 'icon' => 'objectManager', 'caption' => 'Objektverwaltung', 'onclick' => 'wOpenWin(\'/weblication/grid5/scripts/wProjectmanager.php?action=showObjectManager&project='.wPathName::getDirTop($scriptData['path']).'\', \'wObjectManager\', 960, 640)');
    }

    $additionalData   = array();

    $additionalData[] = array('caption' => 'Objektwizard', 'width' => '380', 'align' => 'left', 'callback' => function($documentPath){

      $viewableStr = '';

      $contentObjectTemplate = wReadWrite::readFile($documentPath);

      $pathMask = '';
      if(preg_match('/<wslEditorPre:objectbuilderEditmask[^>]+mask="([^"]+)/', $contentObjectTemplate, $matches)){
        $pathMask = $matches[1];
        if(wRepository::documentExists($pathMask)){        
          $maskDom = wDOM::parseFile($pathMask);
          $groupObjectEditor = wDOM::executeXPath($maskDom, '//wd:group[@id="contentObjectEditor" and wd:item]');
          if($groupObjectEditor->length > 0){
            $viewableStr .= '<span class="wui-filemanager-link-object" title="Öffnet den Objektwizard, um die Darstellung anzupassen" style="cursor:pointer" onclick="wOpenEditor(\''.$matches['1'].'\', \'\', \'\', \'\', \'\', \'edit\')">Pflegemaske</span>';
          }

          $groupContent1 = wDOM::executeXPath($maskDom, '//wd:group[@id="content1" and wd:item]');            
          if($groupContent1->length > 0){
            $viewableStr .= '<span class="wui-filemanager-link-object"  title="Öffnet den Objektwizard, um die Darstellung anzupassen" style="cursor:pointer" onclick="wOpenEditor(\''.$matches['1'].'\', \'\', \'\', \'\', \'\', \'view\')">Seitendarstellung</span>';
          }

          if(wApplication::getVersion(false) >= 19){          
            $groupListEntry = wDOM::executeXPath($maskDom, '//wd:group[starts-with(@id, "content1_var") and wd:item]');                        
            if($groupListEntry->length > 0){
              $groupListEntryVars = wDOM::executeXPath($maskDom, '//wd:group[starts-with(@id, "content1_var") and wd:item]');                                      
              $viewableStr .= '<span class="wui-filemanager-link-object"  title="Öffnet den Objektwizard, um die Darstellung anzupassen" style="cursor:pointer" onclick="wOpenEditor(\''.$matches['1'].'\', \'\', \'\', \'\', \'\', \'content\')">Inhalte'.($groupListEntryVars->length > 1 ? ' ('.($groupListEntryVars->length).')' : '').'</span>';
            }  
          }


          $groupListEntry = wDOM::executeXPath($maskDom, '//wd:group[@id="listEntry" and wd:item]');                        
          if($groupListEntry->length > 0){
            $groupListEntryVars = wDOM::executeXPath($maskDom, '//wd:group[contains(@id, "listEntry_var") and wd:item]');                                      
            $viewableStr .= '<span class="wui-filemanager-link-object"  title="Öffnet den Objektwizard, um die Darstellung anzupassen" style="cursor:pointer" onclick="wOpenEditor(\''.$matches['1'].'\', \'\', \'\', \'\', \'\', \'listEntry\')">Listeneinträge'.($groupListEntryVars->length > 0 ? ' ('.($groupListEntryVars->length + 1).')' : '').'</span>';
          }            
        }
        else{
          $viewableStr = '<span class="wui-filemanager-link-object"  title="Öffnet den Objektwizard, um die Darstellung anzupassen" style="cursor:pointer" onclick="wOpenEditor(\''.$matches['1'].'\')">Objektwizard</span>';          
        }
      }

      return $viewableStr;
    });
  }

  else if(preg_match('/\/wGlobal\/content$/', $scriptData['path'], $matches)){
    if(wProject::getValueOf(wPathName::getDirTop($scriptData['path']), '/wProject/type/text()') == 'content'){

      $showTitleBeforeName = true;

      $columnsToHide     = array();
      $buttonsToHide     = array('upload');    

      $additionalButtons = array();

      $additionalData    = array();
    }
  }    

  else if(preg_match('/\/wGlobal\/content\/elements$/', $scriptData['path'], $matches)){

    $columnsToHide     = array('size');
    $buttonsToHide     = array('optionsProject', 'upload', 'createFile');    

    $additionalButtons = array();

    $additionalButtons[] = array('id' => 'button_createFile', 'icon' => 'createDocument', 'caption' => 'Wiederverwendbaren Inhalt erstellen', 'onclick' => 'wFilemanager.showMaskCreateFile()');      

    $additionalData    = array();

    $additionalData[]  = array('caption' => 'Enthaltene Elemente', 'width' => '240', 'align' => 'left', 'callback' => function($documentPath){

      $viewableStr = '';

      $nodes = wDocumentData::getNodes($documentPath, '/wd:document/wd:group/wd:item');

      $viewableStr = '<span style="">'.$nodes->length.'</span>';

      return $viewableStr;
    });
  }  
  else if(preg_match('/________\/weblication\/templates\/documents\/csvimport$/', $scriptData['path'], $matches)){

    $columnsToHide    = array('size');

    $additionalButtons   = array();

    //$additionalButtons[] = array('id' => 'createDocument', 'icon' => 'createDocument', 'caption' => 'Objekt-Template erstellen', 'onclick' => 'wFilemanager.showMaskCreateFile()');
    //$additionalButtons[] = array('id' => 'objectmanager', 'icon' => 'edit', 'caption' => 'Objektverwaltung', 'onclick' => 'wFilemanager.toggleMask(\'/weblication/grid5/scripts/wProjectmanager.php?action=showObjectManager&project='.wPathName::getDirTop($scriptData['path']).'&display=blank\', {\'buttonMark\' : this})');
    $additionalButtons[] = array('id' => 'objectmanager', 'icon' => 'objectManager', 'caption' => 'Import-Template erstellen', 'onclick' => 'wOpenWin(\'/weblication/grid5/scripts/wProjectmanager.php?action=showMaskCreateTemplateCsvImport&project='.$scriptData['path'].'\', \'wMaskCreateTemplateCsvImport\', 960, 640)');
  }  
  else if(preg_match('/\/wGlobal\/layout\/templates\/objectMasks$/', $scriptData['path'], $matches)){

    $additionalButtons   = array();

    //$additionalButtons[] = array('id' => 'createDocument', 'icon' => 'createDocument', 'caption' => 'Objekt-Template erstellen', 'onclick' => 'wFilemanager.showMaskCreateFile()');
    //$additionalButtons[] = array('id' => 'objectmanager', 'icon' => 'edit', 'caption' => 'Objektverwaltung', 'onclick' => 'wFilemanager.toggleMask(\'/weblication/grid5/scripts/wProjectmanager.php?action=showObjectManager&project='.wPathName::getDirTop($scriptData['path']).'&display=blank\', {\'buttonMark\' : this})');
    $additionalButtons[] = array('id' => 'objectmanager', 'icon' => 'objectManager', 'caption' => 'Objektverwaltung', 'onclick' => 'wOpenWin(\'/weblication/grid5/scripts/wProjectmanager.php?action=showObjectManager&project='.wPathName::getDirTop($scriptData['path']).'\', \'wObjectManager\', 960, 640)');
  }
  //else if(preg_match('/\/wGlobal\/layout\/styles\/optimized$/', $scriptData['path'], $matches)){
  //  
  //  $columnsToHide     = array('title');    
  //}
  else if(preg_match('/\/newsletters$/', $scriptData['path'], $matches)){
    if(wProject::getValueOf(wPathName::getDirTop($scriptData['path']), '/wProject/type/text()') == 'content'){

      //$showTitleBeforeName = true;

      $columnsToHide     = array('title');
      $buttonsToHide     = array();

      $additionalButtons = array();

      $additionalDataDir[]  = array('caption' => 'Datum', 'width' => '140', 'align' => 'left', 'callback' => function($directoryPath){

        $colValue = '';

        if(wRepository::documentExists($directoryPath.'/sent.csv')){
          $colValue = date('d.m.Y H:i', filemtime($_SERVER['DOCUMENT_ROOT'].$directoryPath.'/sent.csv')).' '.wTexts::getTextSystem('o_clock');
        }
        return $colValue;
      });
      

      $additionalDataDir[]  = array('caption' => 'Betreff', 'width' => '480', 'align' => 'left', 'callback' => function($directoryPath){

        $colValue = '';

        if(wRepository::documentExists($directoryPath.'/config.xml')){
          $colValue = '<span style="">'.wDocumentData::getData($directoryPath.'/config.xml', '/wConfig/subject/text()').'</span>';
        }
        return $colValue;
      });
    }
  }  



?>