- $template_file = "filebrowser.tpl";
- $mode = "";
- if (x($_GET,'mode')) {
- $mode = "?mode=".$_GET['mode'];
+ // Needed to match the correct template in a module that uses a different theme than the user/site/default
+ $theme = Strings::sanitizeFilePathItem(defaults($_GET, 'theme', null));
+ if ($theme && is_file("view/theme/$theme/config.php")) {
+ $a->setCurrentTheme($theme);
- dbesc('Contact Photos'),
- dbesc( t('Contact Photos'))
+ DBA::escape('Contact Photos'),
+ DBA::escape(L10n::t('Contact Photos'))
- function _map_folder1($el){return array(bin2hex($el['album']),$el['album']);};
- $albums = array_map( "_map_folder1" , $albums);
+ function _map_folder1($el)
+ {
+ return [bin2hex($el['album']),$el['album']];
+ };
}
$r = q("SELECT `resource-id`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`filename`) AS `filename`, ANY_VALUE(`type`) AS `type`,
}
$r = q("SELECT `resource-id`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`filename`) AS `filename`, ANY_VALUE(`type`) AS `type`,
FROM `photo` WHERE `uid` = %d $sql_extra AND `album` != '%s' AND `album` != '%s'
GROUP BY `resource-id` $sql_extra2",
intval(local_user()),
FROM `photo` WHERE `uid` = %d $sql_extra AND `album` != '%s' AND `album` != '%s'
GROUP BY `resource-id` $sql_extra2",
intval(local_user()),
- dbesc('Contact Photos'),
- dbesc( t('Contact Photos'))
+ DBA::escape('Contact Photos'),
+ DBA::escape(L10n::t('Contact Photos'))
$types = Image::supportedTypes();
$ext = $types[$rr['type']];
$filename_e = $rr['filename'];
// Take the largest picture that is smaller or equal 640 pixels
$p = q("SELECT `scale` FROM `photo` WHERE `resource-id` = '%s' AND `height` <= 640 AND `width` <= 640 ORDER BY `resource-id`, `scale` LIMIT 1",
$types = Image::supportedTypes();
$ext = $types[$rr['type']];
$filename_e = $rr['filename'];
// Take the largest picture that is smaller or equal 640 pixels
$p = q("SELECT `scale` FROM `photo` WHERE `resource-id` = '%s' AND `height` <= 640 AND `width` <= 640 ORDER BY `resource-id`, `scale` LIMIT 1",
System::baseUrl() . '/photos/' . $a->user['nickname'] . '/image/' . $rr['resource-id'],
$filename_e,
System::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext
System::baseUrl() . '/photos/' . $a->user['nickname'] . '/image/' . $rr['resource-id'],
$filename_e,
System::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext
- function _map_files2($rr){
- $a = get_app();
- list($m1,$m2) = explode("/",$rr['filetype']);
+ function _map_files2($rr)
+ {
+ list($m1, $m2) = explode("/", $rr['filetype']);
- return array(System::baseUrl() . '/attach/' . $rr['id'], $filename_e, System::baseUrl() . '/images/icons/16/' . $filetype . '.png');
+ return [System::baseUrl() . '/attach/' . $rr['id'], $filename_e, System::baseUrl() . '/images/icons/16/' . $filetype . '.png'];
- $tpl = get_markup_template($template_file);
- $o = replace_macros($tpl, array(
+ $tpl = Renderer::getMarkupTemplate($template_file);
+ $o = Renderer::replaceMacros($tpl, [
- '$baseurl' => System::baseUrl(),
- '$path' => array( array( "", t("Files")) ),
+ '$path' => [ [ "", L10n::t("Files")] ],