예제 #1
0
 public function getChooser()
 {
     $oTemplate = $this->constructTemplate('list');
     if ($this->iError === null && is_array($this->aFiles) && count($this->aFiles) > 0) {
         $this->parseTree($oTemplate, ArrayUtil::arrayWithValuesAsKeys($this->aFiles), $this->sFilePath);
     } else {
         $oTemplate->replaceIdentifier('tree', TagWriter::quickTag('p', array(), StringPeer::getString('webdav.no_subdirectories')));
     }
     return $oTemplate;
 }
예제 #2
0
 /**
  * @param string $sPostfix string of template 'list item' identifier
  * retrieve all templates from site template dir that follow a naming convention
  * list template name: examplename.tmpl
  * list_item template name: examplename_item.tmpl
  * @return array assoc of path to examplename in key and value
  */
 public static function getSiteTemplatesForListOutput($sPostfix = '_item')
 {
     $aTemplateList = ArrayUtil::arrayWithValuesAsKeys(Template::listTemplates(DIRNAME_TEMPLATES, true));
     $aListTemplates = array();
     foreach ($aTemplateList as $sPath => $sListName) {
         if (StringUtil::endsWith($sListName, $sPostfix)) {
             $sPath = substr($sListName, 0, -strlen($sPostfix));
             $aListTemplates[$sPath] = $sPath;
         }
     }
     foreach ($aListTemplates as $sListPath) {
         if (!in_array($sListPath, $aTemplateList)) {
             unset($aListTemplates[$sListPath]);
         }
     }
     return $aListTemplates;
 }