本文整理汇总了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);
示例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';
示例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));
示例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);
}
}