Example #1
0
 public function toHtml(array $_ = array(), array $__ = array())
 {
     if (!$this->isVisible()) {
         return true;
     }
     //
     // Filesets are always part of a builder element, thus they provide
     // direct-to-HTML output instead of callbacks into the parent
     //
     // HR
     parent::getHtmlInputRadio(array('name' => 'type', 'label' => 'Type', 'values' => array(array('help' => 'Check this if you ONLY want to match files.', 'label' => 'Files only', 'value' => Build_BuilderElement_Type_Fileset::FILE, 'checked' => $this->isTypeFile() ? true : false), array('help' => 'Check this if you ONLY want to match directories.', 'label' => 'Dirs only', 'value' => Build_BuilderElement_Type_Fileset::DIR, 'checked' => $this->isTypeDir() ? true : false), array('help' => 'Check this if you want to match BOTH files and directories.', 'label' => 'Both', 'value' => Build_BuilderElement_Type_Fileset::BOTH, 'checked' => $this->isTypeBoth() ? true : false))));
     parent::getHtmlInputCheckbox(array('help' => 'Enabling this will automatically exclude files and directories that match the following: *~, #*#, .#*, %*%, ._*, CVS, CVS/**, .cvsignore, SCCS, SCCS/**, vssver.scc, .svn, .svn/**, .DS_Store, .git, .git/**, .gitattributes, .gitignore, .gitmodules, .hg, .hg/**, .hgignore, .hgsub, .hgsubstate, .hgtags, .bzr, .bzr/**, .bzrignore.', 'label' => 'Default excludes?', 'name' => 'defaultExcludes', 'value' => '', 'checked' => $this->getDefaultExcludes()));
     parent::getHtmlInputText(array('name' => 'dir', 'label' => 'Base dir', 'value' => $this->getDir(), 'help' => 'The base directory on which to execute the task.'));
     // Includes
     $includesLine = '';
     if ($this->getInclude()) {
         $includes = $this->getInclude();
         foreach ($includes as $include) {
             $includesLine .= $include . ', ';
         }
         // TODO: Oh god... Seriously do this better:
         if (!empty($includesLine)) {
             $includesLine = substr($includesLine, 0, strlen($includesLine) - 2);
             // Oh god ^2...
         }
     }
     parent::getHtmlInputText(array('name' => 'include', 'label' => 'Files/dirs to include', 'value' => $includesLine, 'help' => 'Comma separated. All files and/or dirs that match this WILL BE considered. Please check http://ant.apache.org/manual/Types/patternset.html for more details.'));
     // Excludes
     $excludesLine = '';
     if ($this->getExclude()) {
         $excludes = $this->getExclude();
         foreach ($excludes as $exclude) {
             $excludesLine .= $exclude . ', ';
         }
         // TODO: Oh god... Seriously do this better:
         if (!empty($excludesLine)) {
             $excludesLine = substr($excludesLine, 0, strlen($excludesLine) - 2);
             // Oh god...
         }
     }
     parent::getHtmlInputText(array('name' => 'exclude', 'label' => 'Files/dirs to exclude', 'value' => $excludesLine, 'help' => 'Comma separated. All files and/or dirs that match this WILL NOT BE considered. Please check http://ant.apache.org/manual/Types/patternset.html for more details.'));
 }