当前位置: 首页>>代码示例>>PHP>>正文


PHP FileManager::prop方法代码示例

本文整理汇总了PHP中FileManager::prop方法的典型用法代码示例。如果您正苦于以下问题:PHP FileManager::prop方法的具体用法?PHP FileManager::prop怎么用?PHP FileManager::prop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileManager的用法示例。


在下文中一共展示了FileManager::prop方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: header

<?php

/**
 * Fetches the properties edit form for the file manager.
 */
$page->layout = false;
header('Content-Type: application/json');
$file = urldecode(join('/', $this->params));
$out = array('title' => __('Properties'), 'body' => $tpl->render('filemanager/properties', array('file' => $file, 'desc' => FileManager::prop($file, 'desc'), 'link' => FileManager::prop($file, 'link'))));
echo json_encode($out);
开发者ID:Selwyn-b,项目名称:elefant,代码行数:10,代码来源:properties.php

示例2: array

	sort ($files);
}

// remove 'files/' from paths and create output list
$list = array ();
foreach ($files as $key => $file) {
	$list[preg_replace ('/^' . preg_quote ($root, '/') . '/', '', $file)] = (object) array (
		'path' => $file,
		'desc' => ''
	);
}

// fetch descriptions
if ($data['desc'] === 'yes') {
	if (!empty ($list)) {
		$descriptions = FileManager::prop (array_keys ($list), 'desc');
		foreach ($descriptions as $file => $desc) {
			$list[$file]->desc = $desc;
		}
	}
}

// display style
if ($data['style'] === 'lightbox') {
	$page->add_style ('/apps/filemanager/css/gallery.css');
	$page->add_style ('/apps/filemanager/css/colorbox/colorbox.css');
	$page->add_script ('/apps/filemanager/js/jquery.colorbox.min.js');

	$template = 'filemanager/gallery';
} else {
	$template = 'filemanager/gallery/embedded';
开发者ID:R-J,项目名称:elefant,代码行数:31,代码来源:gallery.php

示例3: preg_replace

        if (!preg_match('|^/files/|', $data['photo'])) {
            $data['photo'] = null;
        } else {
            $photo = preg_replace('|^/files/|', '', $data['photo']);
            if (!FileManager::verify_file($photo)) {
                $data['photo'] = null;
            }
        }
    } else {
        $data['photo'] = null;
    }
}
$data['photo'] = Image::for_key($data['key'], $data['photo']);
if ((!isset($data['link']) || !$data['link'] || $data['link'] === '') && $data['photo'] !== null) {
    $photo = preg_replace('|^/files/|', '', $data['photo']);
    $data['link'] = FileManager::prop($photo, 'link');
}
if ($data['photo']) {
    $data['src'] = '/' . Image::resize($data['photo'], $data['width'], $data['height'], 'cover', 'ext');
} elseif (isset($data['default'])) {
    if (preg_match('/^https?:\\/\\//', $data['default'])) {
        $data['src'] = $data['default'];
    } else {
        $data['src'] = '/' . Image::resize(ltrim($data['default'], '/'), $data['width'], $data['height'], 'cover', 'ext');
    }
} else {
    $data['src'] = 'http://placehold.it/' . $data['width'] . 'x' . $data['height'];
}
if (!$this->internal) {
    header('Content-Type: application/json');
    echo json_encode(array('success' => true, 'data' => $data));
开发者ID:Selwyn-b,项目名称:elefant,代码行数:31,代码来源:photo.php

示例4: array_map

	}
} else {
	return;
}

if (isset ($data['speed'])) {
	$speed = $data['speed'];
} else {
	$speed = "2000";
}

// get links for each file
$prop_files = array_map (function ($file) {
	return preg_replace ('/^files\//', '', $file);
}, $files);
$prop_links = FileManager::prop ($prop_files, 'link');
$links = array ();
foreach ($prop_links as $f => $link) {
	$links['files/' . $f] = $link;
}

if (isset ($data['ratio'])) {
	$ratio = $data['ratio'];
}

// rewrite if proxy is set
if ($appconf['General']['proxy_handler']) {
	foreach ($files as $k => $file) {
		$files[$k] = str_replace ($root, 'filemanager/proxy/', $file);
	}
}
开发者ID:R-J,项目名称:elefant,代码行数:31,代码来源:slideshow.php


注:本文中的FileManager::prop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。