function fetchElement() { $this->setfolder(); $files = NextendFilesystem::files($this->_folder); $this->_xml->addChild('option', NextendText::_('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') { $this->_xml->addChild('option', htmlspecialchars(ucfirst($files[$i])))->addAttribute('value', NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($this->_folder . $files[$i]))); } } if (nextendIsWordPress()) { $wpfolder = get_template_directory() . '/' . NextendXmlGetAttribute($this->_xml, 'folder') . '/'; if (isset($_GET['nextendpath'])) { echo $wpfolder . "<br />"; } if (NextendFilesystem::existsFolder($wpfolder)) { $files = NextendFilesystem::files($wpfolder); for ($i = 0; $i < count($files); $i++) { $ext = pathinfo($files[$i], PATHINFO_EXTENSION); if ($ext == 'jpg' || $ext == 'jpeg' || $ext == 'png') { $this->_xml->addChild('option', htmlspecialchars(ucfirst($files[$i])))->addAttribute('value', NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($wpfolder . $files[$i]))); } } } } $css = NextendCss::getInstance(); $css->addCssLibraryFile('element/imagelist.css'); $html = "<div class='nextend-imagelist' style='" . NextendXmlGetAttribute($this->_xml, 'style') . "'>"; $html .= parent::fetchElement(); $html .= '</div>'; return $html; }
function fetchElement() { $left = $this->_xml->addChild('option', 'Left'); $left->addAttribute('value', 'left'); $center = $this->_xml->addChild('option', 'Center'); $center->addAttribute('value', 'center'); $right = $this->_xml->addChild('option', 'Right'); $right->addAttribute('value', 'right'); $justify = $this->_xml->addChild('option', 'Justify'); $justify->addAttribute('value', 'justify'); $css = NextendCss::getInstance(); $css->addCssLibraryFile('element/textalign.css'); $html = "<div class='nextend-textalign' style='" . NextendXmlGetAttribute($this->_xml, 'style') . "'>"; $html .= parent::fetchElement(); $html .= '</div>'; return $html; }
function fetchElement() { $this->setfolder(); $files = NextendFilesystem::files($this->_folder); $this->_xml->addChild('option', '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') { $this->_xml->addChild('option', htmlspecialchars(ucfirst($files[$i])))->addAttribute('value', NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($this->_folder . $files[$i]))); } } $css = NextendCss::getInstance(); $css->addCssLibraryFile('element/imagelist.css'); $html = "<div class='nextend-imagelist' style='" . NextendXmlGetAttribute($this->_xml, 'style') . "'>"; $html .= parent::fetchElement(); $html .= '</div>'; return $html; }