Пример #1
0
 function fetchElement()
 {
     $html = N2Html::openTag("div", array('class' => 'n2-imagelist n2-imagelistlabel', 'style' => N2XmlHelper::getAttribute($this->_xml, 'style')));
     $html .= parent::fetchElement();
     $html .= N2Html::closeTag('div');
     return $html;
 }
Пример #2
0
 function fetchElement()
 {
     $this->setfolder();
     $files = N2Filesystem::files($this->_folder);
     if (N2XmlHelper::getAttribute($this->_xml, 'required') == '') {
         $this->_xml->addChild('option', n2_('No image'))->addAttribute('value', -1);
     }
     for ($i = 0; $i < count($files); $i++) {
         $ext = pathinfo($files[$i], PATHINFO_EXTENSION);
         if ($ext == 'jpg' || $ext == 'jpeg' || $ext == 'png' || $ext == 'svg' || $ext == 'gif') {
             $this->_xml->addChild('option', htmlspecialchars(ucfirst($files[$i])))->addAttribute('value', N2Filesystem::toLinux(N2Filesystem::pathToRelativePath($this->_folder . $files[$i])));
         }
     }
     $html = N2Html::openTag("div", array('class' => 'n2-imagelist', 'style' => N2XmlHelper::getAttribute($this->_xml, 'style')));
     $html .= parent::fetchElement();
     $html .= N2Html::closeTag('div');
     return $html;
 }