Browse Source

hardcoded change: enclose equal types of content elements

master
Dominik Schmidt-Philipp 1 day ago
parent
commit
0ba8bbbc5e
2 changed files with 41 additions and 6 deletions
  1. +1
    -1
      app/modules/ceimage.php
  2. +40
    -5
      app/modules/filesinfolders.php

+ 1
- 1
app/modules/ceimage.php View File

$class = 'full'; $class = 'full';
} }
if (isset($request[3])) { if (isset($request[3])) {
$width=self::is_width($request[3]) ? $request[3] : false;
$width=self::is_width($request[3]) ? $request[3] : null;
} }


if ($image) { if ($image) {

+ 40
- 5
app/modules/filesinfolders.php View File

foreach($this->structs[$domain_key]['tpl'] as $key=>$file) { foreach($this->structs[$domain_key]['tpl'] as $key=>$file) {
$str = \Template::instance()->render(substr($file,7)); $str = \Template::instance()->render(substr($file,7));
$str = self::linkify($str); $str = self::linkify($str);
$this->content[$domain][$key."00tpl"] = sprintf(
$this->content[$domain][$key."00.tpl"] = sprintf(
"<div class=\"item %s %s\">%s</div>", "<div class=\"item %s %s\">%s</div>",
'', '',
$key, $key,
$image_include_version = 2; $image_include_version = 2;
switch ($image_include_version) { switch ($image_include_version) {
case 1: case 1:
$this->content[$domain][$key."10image"] = sprintf(
$this->content[$domain][$key."10.image"] = sprintf(
"<img class=\"bulkImportedImage $bulkIncludePic\" src=\"/$file\" />" "<img class=\"bulkImportedImage $bulkIncludePic\" src=\"/$file\" />"
); );
break; break;
case 2: case 2:
$module = new CEimage(['image',$file,$bulkIncludePic,'gallery']); $module = new CEimage(['image',$file,$bulkIncludePic,'gallery']);
$this->content[$domain][$key."10image"] = $module->index();
$this->content[$domain][$key."10.image"] = $module->index();
unset($module); unset($module);
break; break;
case 3: case 3:
; ;
if ($bulkIncludeAudio) { if ($bulkIncludeAudio) {
foreach ($this->structs[$domain_key]['audio'] as $key=>$file) { foreach ($this->structs[$domain_key]['audio'] as $key=>$file) {
$this->content[$domain][$key."20audio"] = sprintf(
$this->content[$domain][$key."20.audio"] = sprintf(
'<a href="%s" class="audio">%s</a><br>', '<a href="%s" class="audio">%s</a><br>',
$file, $key $file, $key
); );
$str .= sprintf("<tr>%s</tr>",$tmp); $str .= sprintf("<tr>%s</tr>",$tmp);
} }
$str.="</table>"; $str.="</table>";
$this->content[$domain][$key."30csv"] = $str;
$this->content[$domain][$key."30.csv"] = $str;
}

$content_order = 2;
switch ($content_order) {
case 0:
// don't do any processing
// content types appear together
// but are not enclosed in a div
break;
case 1;
// all content files appear in alphabetical order
ksort($this->content[$domain]);
break;
case 2:
// all content files appear in alphabetical order
// groups of same content types are enclosed in a div
ksort($this->content[$domain]);

$prev = null;
foreach ($this->content[$domain] as $key=>$value) {
$html = "";
$type = array_pop(explode('.',$key));

if ($type == $prev) {
continue;
} elseif ($prev != null) {
$html = "</div>";
}
$html .= "<div class=\"source-file-type-$type-container\">";

$this->content[$domain][$key] = $html.$value;

$prev = $type;
}
$this->content[$domain][] = "</div>";
} }
} }
} }

Loading…
Cancel
Save