Переглянути джерело

hardcoded change: enclose equal types of content elements

master
Dominik Schmidt-Philipp 1 день тому
джерело
коміт
0ba8bbbc5e
2 змінених файлів з 41 додано та 6 видалено
  1. +1
    -1
      app/modules/ceimage.php
  2. +40
    -5
      app/modules/filesinfolders.php

+ 1
- 1
app/modules/ceimage.php Переглянути файл

@@ -55,7 +55,7 @@ class CEimage
$class = 'full';
}
if (isset($request[3])) {
$width=self::is_width($request[3]) ? $request[3] : false;
$width=self::is_width($request[3]) ? $request[3] : null;
}

if ($image) {

+ 40
- 5
app/modules/filesinfolders.php Переглянути файл

@@ -150,7 +150,7 @@ class FilesInFolders {
foreach($this->structs[$domain_key]['tpl'] as $key=>$file) {
$str = \Template::instance()->render(substr($file,7));
$str = self::linkify($str);
$this->content[$domain][$key."00tpl"] = sprintf(
$this->content[$domain][$key."00.tpl"] = sprintf(
"<div class=\"item %s %s\">%s</div>",
'',
$key,
@@ -168,13 +168,13 @@ class FilesInFolders {
$image_include_version = 2;
switch ($image_include_version) {
case 1:
$this->content[$domain][$key."10image"] = sprintf(
$this->content[$domain][$key."10.image"] = sprintf(
"<img class=\"bulkImportedImage $bulkIncludePic\" src=\"/$file\" />"
);
break;
case 2:
$module = new CEimage(['image',$file,$bulkIncludePic,'gallery']);
$this->content[$domain][$key."10image"] = $module->index();
$this->content[$domain][$key."10.image"] = $module->index();
unset($module);
break;
case 3:
@@ -190,7 +190,7 @@ class FilesInFolders {
;
if ($bulkIncludeAudio) {
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>',
$file, $key
);
@@ -207,7 +207,42 @@ class FilesInFolders {
$str .= sprintf("<tr>%s</tr>",$tmp);
}
$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>";
}
}
}

Завантаження…
Відмінити
Зберегти