method getMediasNotes documentation in bbn\Appui\Note
Selects from db all medias that have the property content not null and a correspondent existing file.
function(int $start, int $limit)
{
$res = [];
$cf = &$this->class_cfg;
$all = $this->db->rselectAll(
[
'table' => $cf['tables']['medias'],
'fields' => $cf['arch']['medias'],
'where' => [
'conditions' => [[
'field' => $cf['arch']['medias']['private'],
'value' => 0,
], [
'field' => $cf['arch']['medias']['content'],
'operator' => 'isnotnull',
]],
],
'start' => $start,
'limit' => $limit,
]
);
if (!empty($all)) {
$root = \bbn\Mvc::getDataPath('appui-note') . 'media/';
foreach ($all as $i => $a) {
if (bbn\Str::isJson($a['content']) && ($media_obj = $this->getMediaInstance())) {
$content = json_decode($a['content'], true);
$path = $root . $content['path'] . '/';
$full_path = $path . $a['id'] . '/' . $a['name'];
if (file_exists($full_path)) {
$all[$i]['notes'] = $this->getMediaNotes($a['id']);
//if the media is an image it takes the thumb 60, 60 for src
if ($media_obj->isImage($full_path) && ($thumb = $media_obj->getThumbs($full_path))) {
$all[$i]['is_image'] = true;
}
$res[] = $all[$i];
}
}
}
}
return $res;
}
Selects from db all medias that have the property content not null and a correspondent existing file. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2023
BBN Solutions