[FEATURE] Restyle and reorder lowlevel>Configuration 73/33873/2
authorFelix Kopp <felix-source@phorax.com>
Fri, 7 Nov 2014 10:10:49 +0000 (11:10 +0100)
committerBenjamin Mack <benni@typo3.org>
Sun, 9 Nov 2014 08:34:48 +0000 (09:34 +0100)
Restructure search form. Implement Styles.css and remove
inline CSS. Remove cropping of lines. Equalize array tree.

Resolves: #62762
Releases: master
Change-Id: I561d2bd10f2a23944fdeab0e5ba6e0fb548a5b04
Reviewed-on: http://review.typo3.org/33873
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/lowlevel/Classes/Utility/ArrayBrowser.php
typo3/sysext/lowlevel/Classes/View/ConfigurationView.php
typo3/sysext/lowlevel/Resources/Private/Templates/Backend/Configuration.html
typo3/sysext/lowlevel/Resources/Public/Styles/styles.css [new file with mode: 0644]

index afe2f51..e55109d 100644 (file)
@@ -112,15 +112,10 @@ class ArrayBrowser {
                        $HTML .= $this->wrapArrayKey($label, $depth, !$isArray ? $value : '');
                        if (!$isArray) {
                                $theValue = $value;
-                               if ($this->fixedLgd) {
-                                       $imgBlocks = ceil(1 + strlen($depthData) / 77);
-                                       $lgdChars = 68 - ceil(strlen(('[' . $key . ']')) * 0.8) - $imgBlocks * 3;
-                                       $theValue = $this->fixed_lgd($theValue, $lgdChars);
-                               }
                                if ($this->searchKeys[$depth]) {
-                                       $HTML .= '=<span style="color:red;">' . $this->wrapValue($theValue, $depth) . '</span>';
+                                       $HTML .= ' = <span style="color:red;">' . $this->wrapValue($theValue, $depth) . '</span>';
                                } else {
-                                       $HTML .= '=' . $this->wrapValue($theValue, $depth);
+                                       $HTML .= ' = ' . $this->wrapValue($theValue, $depth);
                                }
                        }
                        $HTML .= '<br />';
@@ -157,13 +152,14 @@ class ArrayBrowser {
        public function wrapArrayKey($label, $depth, $theValue) {
                // Protect label:
                $label = htmlspecialchars($label);
+
                // If varname is set:
                if ($this->varName && !$this->dontLinkVar) {
                        $variableName = $this->varName . '[\'' . str_replace('.', '\'][\'', $depth) . '\'] = ' . (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($theValue) ? '\'' . addslashes($theValue) . '\'' : $theValue) . '; ';
                        $label = '<a href="' . htmlspecialchars((\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('M')) . '&varname=' . urlencode($variableName))) . '#varname">' . $label . '</a>';
                }
-               // Return:
-               return '[' . $label . ']';
+
+               return $label;
        }
 
        /**
@@ -204,22 +200,6 @@ class ArrayBrowser {
        }
 
        /**
-        * Fixed length function
-        *
-        * @param string $string String to process
-        * @param int $chars Max number of chars
-        * @return string Processed string
-        */
-       public function fixed_lgd($string, $chars) {
-               if ($chars >= 4) {
-                       if (strlen($string) > $chars) {
-                               return substr($string, 0, ($chars - 3)) . '...';
-                       }
-               }
-               return $string;
-       }
-
-       /**
         * Function modifying the depthKey array
         *
         * @param array $arr Array with instructions to open/close nodes.
index 595a3f9..6c1ce61 100644 (file)
@@ -88,6 +88,7 @@ class ConfigurationView {
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
                $this->doc->setModuleTemplate('EXT:lowlevel/Resources/Private/Templates/config.html');
                $this->doc->form = '<form action="" method="post">';
+               $this->doc->addStyleSheet('module', 'sysext/lowlevel/Resources/Public/Styles/styles.css');
        }
 
        /**
@@ -126,6 +127,7 @@ class ConfigurationView {
         * @return void
         */
        public function main() {
+               /** @var \TYPO3\CMS\Lowlevel\Utility\ArrayBrowser $arrayBrowser */
                $arrayBrowser = GeneralUtility::makeInstance('TYPO3\\CMS\\Lowlevel\\Utility\\ArrayBrowser');
                $label = $this->MOD_MENU['function'][$this->MOD_SETTINGS['function']];
                $search_field = GeneralUtility::_GP('search_field');
@@ -135,7 +137,6 @@ class ConfigurationView {
                $this->view->assign('label', $label);
                $this->view->assign('search_field', $search_field);
                $this->view->assign('checkbox_checkRegexsearch', BackendUtility::getFuncCheck(0, 'SET[regexsearch]', $this->MOD_SETTINGS['regexsearch'], '', '', 'id="checkRegexsearch"'));
-               $this->view->assign('checkbox_checkFixedLgd', BackendUtility::getFuncCheck(0, 'SET[fixedLgd]', $this->MOD_SETTINGS['fixedLgd'], '', '', 'id="checkFixedLgd"'));
 
                switch ($this->MOD_SETTINGS['function']) {
                        case 0:
index db8d9d5..8fe1f37 100644 (file)
@@ -1,13 +1,14 @@
 <f:flashMessages renderMode="div"/>
 
 <h1><f:translate key="configuration" /></h1>
+
 <h2>{label}</h2>
+
 <div id="lowlevel-config">
        <label for="search_field">
                <f:translate key="enterSearchPhrase" />
        </label>
        <input type="search" id="search_field" name="search_field" value="{search_field}" style="width:192px;"/>
-       <input type="submit" name="search" id="search" value="{f:translate(key: 'search')}"/>
 
        <div class="checkbox">
                <label for="checkRegexsearch">
                        <f:translate key="useRegExp" />
                </label>
        </div>
-       <div class="checkbox">
-               <label for="checkFixedLgd">
-                       <f:format.raw>{checkbox_checkFixedLgd}</f:format.raw>
-                       <f:translate key="cropLines" />
-               </label>
-       </div>
+
+       <input type="submit" name="search" id="search" value="{f:translate(key: 'search')}"/>
 </div>
-<div style="padding-top: 5px;" id="lowlevel-config-var">
+
+<div id="lowlevel-config-var">
        <f:if condition="{varname}">
                <strong>
                        <f:translate key="variable" />
@@ -40,6 +38,6 @@
        </f:if>
 </div>
 
-<div class="nowrap" style="margin-top: 20px;">
+<div class="nowrap">
        <f:format.raw>{tree}</f:format.raw>
 </div>
\ No newline at end of file
diff --git a/typo3/sysext/lowlevel/Resources/Public/Styles/styles.css b/typo3/sysext/lowlevel/Resources/Public/Styles/styles.css
new file mode 100644 (file)
index 0000000..884f8de
--- /dev/null
@@ -0,0 +1,3 @@
+#lowlevel-config {
+       margin-bottom: 20px;
+}
\ No newline at end of file