]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
Invisible/locked menus are now styleable with CSS classes (sub_)menu_[in]visible_css...
[mailer.git] / inc / functions.php
index 864e26f9678eda20f32524877b8129e96053070e..5a5507bab8f13d8c8a12b519fba444de03eaf2f8 100644 (file)
@@ -872,6 +872,34 @@ function translateUserStatus ($status) {
        return $ret;
 }
 
+// "Translates" 'visible' and 'locked' to a CSS class
+function translateMenuVisibleLocked ($content, $prefix = '') {
+       // Translate 'visible' and keep an eye on the prefix
+       switch ($content[$prefix . 'visible']) {
+               // Should be visible
+               case 'Y': $content[$prefix . 'visible_css'] = $prefix . 'menu_visible_css'  ; break;
+               case 'N': $content[$prefix . 'visible_css'] = $prefix . 'menu_invisible_css'; break;
+               default:
+                       // Please report this
+                       debug_report_bug('Unsupported visible value detected. content=<pre>'.print_r($content, true).'</pre>');
+                       break;
+       } // END - switch
+
+       // Translate 'locked' and keep an eye on the prefix
+       switch ($content[$prefix . 'locked']) {
+               // Should be locked
+               case 'Y': $content[$prefix . 'locked_css'] = $prefix . 'menu_locked_css'  ; break;
+               case 'N': $content[$prefix . 'locked_css'] = $prefix . 'menu_unlocked_css'; break;
+               default:
+                       // Please report this
+                       debug_report_bug('Unsupported locked value detected. content=<pre>'.print_r($content, true).'</pre>');
+                       break;
+       } // END - switch
+
+       // Return the resulting array
+       return $content;
+}
+
 // Generates an URL for the dereferer
 function generateDerefererUrl ($URL) {
        // Don't de-refer our own links!