本文整理汇总了PHP中NextendFilesystem类的典型用法代码示例。如果您正苦于以下问题:PHP NextendFilesystem类的具体用法?PHP NextendFilesystem怎么用?PHP NextendFilesystem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NextendFilesystem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
static function render($slider, $id, $params)
{
$html = '';
$indicatorstripe = $params->get('indicatorstripe', false);
if ($indicatorstripe && $indicatorstripe != -1) {
$displayclass = self::getDisplayClass($params->get('widgetindicatordisplay', '0|*|always|*|0|*|0'), true) . 'nextend-indicator ';
$css = NextendCss::getInstance();
$css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'stripe' . DIRECTORY_SEPARATOR . 'style.css'));
list($style, $data) = self::getPosition($params->get('indicatorposition', ''));
$style .= 'z-index:10;';
$width = NextendParse::parse($params->get('indicatorwidth', '100%'));
if (is_numeric($width) || $width == 'auto' || substr($width, -1) == '%') {
$style .= 'width:' . $width . ';';
} else {
$data .= 'data-sswidth="' . $width . '" ';
}
$size = intval($params->get('indicatorsize', 50));
list($colorhex, $rgbacss) = NextendColor::colorToCss($params->get('indicatorstripecolor', '000000cc'));
list($colorhexbg, $rgbacssbg) = NextendColor::colorToCss($params->get('backgroundstripecolor', '7670c7ff'));
$height = $params->get('indicatorstripeheight', '6');
$info = pathinfo($indicatorstripe);
$class = 'nextend-indicator nextend-indicator-stripe nextend-indicator-stripe-' . basename($indicatorstripe, '.' . $info['extension']);
$html = '<div class="' . $displayclass . 'nextend-indicator-stripe-container" style="' . $style . 'background-color:' . $colorhexbg . '; background-color:' . $rgbacssbg . '; height: ' . $height . 'px;" ' . $data . '><div class="' . $class . '" style="width: 0%; background-color:' . $colorhex . '; background-color:' . $rgbacss . '; height: ' . $height . 'px;"></div></div>';
$html .= "\r\n <script type='text/javascript'>\r\n njQuery(document).ready(function () {\r\n var stripe = window.njQuery('#" . $id . " .nextend-indicator-stripe');\r\n window['" . $id . "-indicator'] = {\r\n hide: function(){\r\n stripe.hide();\r\n },\r\n show: function(){\r\n stripe.show();\r\n },\r\n refresh: function(val){\r\n stripe.css('width', val+'%');\r\n }\r\n };\r\n });\r\n </script>\r\n ";
}
return $html;
}
示例2: addFolder
function addFolder($folder)
{
$this->_xml->addChild('option', $folder)->addAttribute('value', $folder);
foreach (NextendFilesystem::folders($folder) as $f) {
$this->addFolder($folder . $f . '/');
}
}
示例3: fetchElement
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;
}
示例4: generateOptions
function generateOptions(&$xml)
{
$template = (string) $this->_xml;
$cssfile = NextendFilesystem::translateToMediaPath(str_replace(DIRECTORY_SEPARATOR, '/', dirname($this->_form->_xmlfile)) . '/style.');
$css = NextendCss::getInstance();
if (NextendFilesystem::fileexists($cssfile . 'less')) {
$css->enableLess();
$cssfile .= 'less';
$css->addCssFile(array($cssfile, $cssfile, array('id' => 'body')));
} else {
$cssfile .= 'css';
$css->addCssFile($cssfile);
}
$prefix = NextendXmlGetAttribute($this->_xml, 'prefix');
$this->_values = array();
$html = '';
foreach ($xml->option as $option) {
$v = NextendXmlGetAttribute($option, 'value');
$this->_values[] = $v;
if ($v != -1) {
$info = pathinfo($v);
$class = $prefix . basename($v, '.' . $info['extension']);
$html .= '
<div class="nextend-radio-option nextend-imagelist-option' . $this->isSelected($v) . '">
' . str_Replace('{image}', NextendUri::pathToUri($v), str_Replace('{class}', $class, $template)) . '
</div>';
} else {
$html .= '<div class="nextend-radio-option' . $this->isSelected($v) . '">' . (string) $option . '</div>';
}
}
return $html;
}
示例5: getFontUrl
function getFontUrl()
{
$css = NextendCss::getInstance();
$url = 'https://fonts.googleapis.com/css?family=';
$subset = '';
if (count($this->_fonts)) {
foreach ($this->_fonts as $family => $font) {
$style = explode(',', $font[0]);
$style = array_filter(array_unique($style));
foreach ($style as $k => $s) {
$file = NEXTENDLIBRARYASSETS . 'fonts/' . preg_replace("/[^a-z0-9]/", '', strtolower($family)) . '/' . $s . '/s.css';
if (NextendFilesystem::existsFile($file)) {
unset($style[$k]);
$css->addCssFile($file, null, true);
}
}
if (count($style)) {
$url .= urlencode($family) . ':' . implode(',', $style) . '|';
$subset .= $font[1] . ',';
}
}
}
if ($url == 'https://fonts.googleapis.com/css?family=') {
return '';
}
$url = substr($url, 0, -1);
$subset = explode(',', $subset);
$subset = array_filter(array_unique($subset));
$url .= '&subset=' . implode(',', $subset);
return $url;
}
示例6: render
static function render($slider, $id, $params)
{
$html = '';
$previous = $params->get('previous', false);
$next = $params->get('next', false);
$enabled = $previous && $previous != -1 || $next && $next != -1;
if ($enabled) {
$displayclass = self::getDisplayClass($params->get('widgetarrowdisplay', '0|*|always|*|0|*|0'), true);
$css = NextendCss::getInstance();
$css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'image' . DIRECTORY_SEPARATOR . 'style.css'));
if ($previous && $previous != -1) {
list($style, $data) = self::getPosition($params->get('previousposition', ''));
$info = pathinfo($previous);
$class = 'nextend-arrow-previous nextend-image nextend-image-previous nextend-image-previous-' . basename($previous, '.' . $info['extension']);
$html .= '<div onclick="njQuery(\'#' . $id . '\').smartslider(\'previous\');" class="' . $displayclass . $class . '" style="' . $style . '" ' . $data . '></div>';
}
if ($next && $next != -1) {
list($style, $data) = self::getPosition($params->get('nextposition', ''));
$info = pathinfo($next);
$class = 'nextend-arrow-next nextend-image nextend-image-next nextend-image-next-' . basename($next, '.' . $info['extension']);
$html .= '<div onclick="njQuery(\'#' . $id . '\').smartslider(\'next\');" class="' . $displayclass . $class . '" style="' . $style . '" ' . $data . '></div>';
}
}
return $html;
}
示例7: render
function render($xmlpath, $data)
{
$css = NextendCss::getInstance();
$js = NextendJavascript::getInstance();
$css->addCssLibraryFile('common.css');
$css->addCssLibraryFile('window.css');
$css->addCssLibraryFile('configurator.css');
$js->loadLibrary('dojo');
nextendimport('nextend.form.form');
$form = new NextendForm();
$form->loadArray($data);
$form->loadXMLFile($xmlpath);
echo $form->render('settings');
$js->addLibraryJsAssetsFile('dojo', 'form.js');
$js->addLibraryJs('dojo', '
new NextendForm({
container: "smartslider-form",
data: ' . json_encode($form->_data) . ',
xml: "' . NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($xmlpath)) . '",
control_name: "settings",
url: "' . NextendUri::ajaxUri('nextend', 'smartslider') . '",
loadedJSS: ' . json_encode($js->generateArrayJs()) . ',
loadedCSS: ' . json_encode($css->generateArrayCSS()) . '
});
', true);
}
示例8: render
function render($tpl)
{
$tplpath = $this->_path . 'tpl/' . $tpl . '.php';
if (NextendFilesystem::existsFile($tplpath)) {
include $tplpath;
}
}
示例9: nextendimportpath
function nextendimportpath($file)
{
$file .= '.php';
if (NextendFilesystem::fileexists($file)) {
require_once $file;
return true;
}
return false;
}
示例10: addCSS
function addCSS()
{
parent::addCSS();
$css = NextendCss::getInstance();
end($css->_cssFiles);
$last = key($css->_cssFiles);
$override = str_replace(WP_PLUGIN_DIR, get_template_directory(), $css->_cssFiles[$last][1]);
if (NextendFilesystem::fileexists($override)) {
$css->_cssFiles[$last][1] = $override;
}
}
示例11: onNextendSliderGeneratorList
function onNextendSliderGeneratorList(&$group, &$list, $showall = false)
{
if ($showall || smartsliderIsFull()) {
$installed = NextendFilesystem::existsFolder(JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_flexicontent');
if ($showall || $installed) {
$group[$this->_group] = 'FLEXIcontent';
if (!isset($list[$this->_group])) {
$list[$this->_group] = array();
}
$list[$this->_group][$this->_group . '_items'] = array(NextendText::_('Items'), $this->getPath() . 'items' . DIRECTORY_SEPARATOR, true, true, $installed ? true : 'http://extensions.joomla.org/extensions/authoring-a-content/content-construction/10667', null);
}
}
}
示例12: onNextendSliderGeneratorList
function onNextendSliderGeneratorList(&$group, &$list, $showall = false)
{
if ($showall || smartsliderIsFull()) {
$installed = NextendFilesystem::existsFolder(JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_phocagallery');
if ($showall || $installed) {
$group[$this->_group] = 'Phoca Gallery';
if (!isset($list[$this->_group])) {
$list[$this->_group] = array();
}
$list[$this->_group][$this->_group . '_phocagalleryimages'] = array(NextendText::_('Images'), $this->getPath() . 'phocagalleryimages' . DIRECTORY_SEPARATOR, true, true, $installed ? true : 'http://extensions.joomla.org/extensions/photos-a-images/galleries/photo-gallery/3150', 'image_extended');
}
}
}
示例13: makeUrl
function makeUrl($matches)
{
if (substr($matches[1], 0, 5) == 'data:') {
return $matches[0];
}
if (substr($matches[1], 0, 4) == 'http') {
return $matches[0];
}
if (substr($matches[1], 0, 2) == '//') {
return $matches[0];
}
return 'url(' . str_replace(array('http://', 'https://'), '//', NextendFilesystem::pathToAbsoluteURL(dirname($this->path))) . '/' . $matches[1] . ')';
}
示例14: onNextendSliderGeneratorList
function onNextendSliderGeneratorList(&$group, &$list, $showall = false)
{
if ($showall || smartsliderIsFull()) {
$installed = NextendFilesystem::existsFile(JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_jshopping' . DIRECTORY_SEPARATOR . 'jshopping.php');
if ($showall || $installed) {
$group[$this->_group] = 'JoomShopping';
if (!isset($list[$this->_group])) {
$list[$this->_group] = array();
}
$list[$this->_group][$this->_group . '_products'] = array(NextendText::_('Products'), $this->getPath() . 'products' . DIRECTORY_SEPARATOR, true, true, $installed ? true : 'http://extensions.joomla.org/extensions/e-commerce/shopping-cart/5378', 'product');
}
}
}
示例15: auth
function auth()
{
$folder = NextendRequest::getVar('folder');
if ($folder) {
$authfile = NextendFilesystem::pathToAbsolutePath($folder) . 'auth.php';
if (NextendFilesystem::fileexists($authfile)) {
require_once $authfile;
if (function_exists('nextend_api_auth_flow')) {
nextend_api_auth_flow();
}
}
}
exit;
}