Skip to content

Commit

Permalink
Overhaul Filebrowser styling
Browse files Browse the repository at this point in the history
We remove the inline styles, add FontAwesome icons to the toggle
buttons, generally clean up the HTML a bit, and add a heading for the
CMS browser.

This patch has been provided by @frase-git.
  • Loading branch information
cmb69 committed Oct 27, 2018
1 parent 58979a2 commit 5740f42
Show file tree
Hide file tree
Showing 6 changed files with 337 additions and 296 deletions.
18 changes: 9 additions & 9 deletions plugins/filebrowser/classes/View.php
Expand Up @@ -138,7 +138,7 @@ private function folderList(array $folders)
global $tx;

$html = '<ul><li class="openFolder"><a href="?'
. XH_hsc($this->linkParams) . '"><span class="fa fa-folder fa-fw fa-lg"></span> '
. XH_hsc($this->linkParams) . '"><span class="fa fa-folder-open fa-fw fa-lg"></span> '
. $tx['title']['userfiles'] . ' ' . $this->lang['folder'] . '</a>';
if (!empty($folders)) {
$html .= '<ul>';
Expand Down Expand Up @@ -210,7 +210,7 @@ private function subfolderList(array $folders)
foreach ($folders as $folder) {
$name = str_replace($this->currentDirectory, '', $folder);
$html .= '<li class="folder"><span class="fa fa-folder fa-fw fa-lg"></span>'
. '<form style="display: inline;" method="post" action="'
. '<form method="post" action="'
. $action . '" class="filebrowser_delete_folder" data-path="'
. XH_hsc($this->basePath) . $folder . '">'
. '<button class="xhButtonImg" title="'
Expand Down Expand Up @@ -253,8 +253,8 @@ private function fileList(array $files)
$action = $sn . '?' . XH_hsc($_SERVER['QUERY_STRING']);
foreach ($files as $file) {
$class = $class == 'odd' ? 'even' : 'odd';
$html .= '<li style="white-space:nowrap;" class="' . $class . '">'
. '<form style="display: inline;" method="post" action="'
$html .= '<li class="' . $class . '">'
. '<form method="post" action="'
. $action . '" class="filebrowser_delete_file" data-path="'
. XH_hsc($this->currentDirectory . $file) . '">'
. '<button class="xhButtonImg" title="'
Expand All @@ -265,7 +265,7 @@ private function fileList(array $files)
. $file . '">'
. $_XH_csrfProtection->tokenInput()
. '</form>'
. '<form method="post" style="display:inline;" action="'
. '<form method="post" action="'
. $action . '" class="filebrowser_rename_file" data-path="'
. XH_hsc($file) . '">'
. '<input type="hidden" name="renameFile" value="'
Expand All @@ -276,7 +276,7 @@ private function fileList(array $files)
.'<span class="fa fa-tag fa-lg fa-fw"></span></button>'
. $_XH_csrfProtection->tokenInput()
. '</form>'
. '<a style="position:relative" class="xhfbfile" href="'
. '<a class="xhfbfile" href="'
. $this->basePath . $this->currentDirectory . $file
. '" target="_blank">' . $file;

Expand Down Expand Up @@ -353,8 +353,8 @@ private function renderImage($path, $file, array $image, $usage = null)
$width = 150;
$height = $width / $ratio;
}
return '<span style="position: relative; z-index: 4; ">'
. '<span style="font-weight: normal; border: none;">'
return '<span>'
. '<span>'
. $image[0] . ' x ' . $image[1] . ' px</span>' . '<br>'
. '<img src="' . $path . '" width="' . $width . '" height="'
. $height . '" alt="' . $file . '">'
Expand Down Expand Up @@ -454,7 +454,7 @@ public function info($message, array $args = null)
*/
public function message($message)
{
$this->message .= '<p style="width: auto;">' . $message . '</p>';
$this->message .= '<p>' . $message . '</p>';
}

/**
Expand Down

0 comments on commit 5740f42

Please sign in to comment.