File indexing completed on 2025-05-04 05:29:34

0001 /**
0002  *  ocs-webserver
0003  *
0004  *  Copyright 2016 by pling GmbH.
0005  *
0006  *    This file is part of ocs-webserver.
0007  *
0008  *    This program is free software: you can redistribute it and/or modify
0009  *    it under the terms of the GNU Affero General Public License as
0010  *    published by the Free Software Foundation, either version 3 of the
0011  *    License, or (at your option) any later version.
0012  *
0013  *    This program is distributed in the hope that it will be useful,
0014  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
0015  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0016  *    GNU Affero General Public License for more details.
0017  *
0018  *    You should have received a copy of the GNU Affero General Public License
0019  *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
0020  **/
0021 /**
0022  * backend navigation with yui-lib
0023  */
0024 var aItemData = [
0025 
0026     {
0027         text: "General",
0028         submenu: {
0029             id: "allabout",
0030             itemdata: [
0031                 {text: "Dashboard", url: "/backend/"},
0032                 {text: "File-Browser", url: "/backend/index/filebrowser"}
0033             ]
0034         }
0035     },
0036     {
0037         text: "Product",
0038         submenu: {
0039             id: "projects",
0040             itemdata: [
0041                 {text: "Products", url: "/backend/project"},
0042                 {text: "Clones", url: "/backend/projectclone"},
0043                 {text: "Claims", url: "/backend/claim"}
0044             ]
0045         }
0046     },
0047     {
0048         text: "GHNS",
0049         submenu: {
0050             id: "ghns",
0051             itemdata: [
0052                 {text: "GHNS-Excluded", url: "/backend/ghnsexcluded"}
0053             ]
0054         }
0055     },
0056     {
0057         text: "Category",
0058         submenu: {
0059             id: "category",
0060             itemdata: [
0061                 {text: "Categories", url: "/backend/categories"},
0062                 {text: "Browse-List-Types", url: "/backend/browselisttype"},
0063                 {text: "Virtual Categories", url: "/backend/vcategories"},
0064                 {text: "Category-Tag", url: "/backend/categorytag"},
0065                 {text: "Category-Tag-Group", url: "/backend/categorytaggroup"},
0066                 
0067             ]
0068         }
0069     },
0070     {
0071         text: "User",
0072         submenu: {
0073             id: "user",
0074             itemdata: [
0075                 {text: "Users", url: "/backend/user"},
0076                 {text: "Config Paypal-Valid-Stati", url: "/backend/paypalvalidstatus"},
0077                 {text: "Generate Letter Avatar", url: "/backend/letteravatar"}
0078             ]
0079         }
0080     },
0081     {
0082         text: "Payout",
0083         submenu: {
0084             id: "payout",
0085             itemdata: [
0086                 {text: "Member Payouts", url: "/backend/memberpayout"},
0087                 {text: "Config Payout-Stati", url: "/backend/payoutstatus"},
0088                 {text: "Member Paypal-Addresses", url: "/backend/memberpaypaladdress"}
0089             ]
0090         }
0091     },
0092     {
0093         text: "Comment",
0094         submenu: {
0095             id: "comments",
0096             itemdata: [
0097                 {text: "Comments", url: "/backend/comments"}
0098             ]
0099         }
0100     },
0101     {
0102         text: "Content",
0103         submenu: {
0104             id: "contents",
0105             itemdata: [
0106                 {text: "eMail-Templates", url: "/backend/mail"}
0107             ]
0108         }
0109     },
0110     {
0111         text: "Reported",
0112         submenu: {
0113             id: "reports",
0114             itemdata: [
0115                 {text: "Comments", url: "/backend/reportcomments"},
0116                 {text: "Products", url: "/backend/reportproducts"}
0117             ]
0118         }
0119     },
0120     {
0121         text: "Tags",
0122         submenu: {
0123             id: "tags",
0124             itemdata: [
0125                 {text: "Manage", url: "/backend/tags"}
0126             ]
0127         }
0128     },
0129     { 
0130         text: "Section",
0131         submenu: {
0132             id: "section",
0133             itemdata: [
0134                 {text: "Sections", url: "/backend/section"},
0135                 {text: "Categories", url: "/backend/sectioncategories"},
0136                 {text: "Sponsors", url: "/backend/sponsor"}
0137             ]
0138         }
0139     },
0140     {
0141         text: "Store",
0142         submenu: {
0143             id: "stores",
0144             itemdata: [
0145                 {text: "Config", url: "/backend/store"},
0146                 {text: "Categories", url: "/backend/storecategories"},
0147                 {text: "Virtual Categories", url: "/backend/vstorecategories"},
0148                 {text: "Init Cache", url: "/backend/store/initcache"}
0149             ]
0150         }
0151     },
0152     {
0153         text: "Operating System",
0154         submenu: {
0155             id: "operatingsystem",
0156             itemdata: [
0157                 {text: "Config", url: "/backend/operatingsystem"}
0158             ]
0159         }
0160     },
0161     {
0162         text: "Import",
0163         submenu: {
0164             id: "import",
0165             itemdata: [
0166                 {text: "Hive Content", url: "/backend/hive"},
0167                 {text: "Hive User", url: "/backend/hiveuser"}
0168             ]
0169         }
0170     },
0171     {
0172         text: "Spam",
0173         submenu: {
0174             id: "spam",
0175             itemdata: [
0176                 {text: "Keywords", url: "/backend/spamkeywords"}
0177             ]
0178         }
0179     },
0180     {
0181         text: "Account",
0182         submenu: {
0183             id: "account",
0184             itemdata: [
0185                 {text: "logout", url: "/logout"},
0186                 {text: "frontend", url: "/"}
0187             ]
0188         }
0189     }
0190 
0191 
0192 ];
0193 
0194 
0195 $(document).ready(function () {
0196 
0197     $("body").addClass("yui-skin-sam");
0198 
0199     var oMenuBar = new YAHOO.widget.MenuBar("ocsbackendnavigation", {
0200         lazyload: true,
0201         itemdata: aItemData
0202     });
0203 
0204     oMenuBar.render(document.body);
0205 
0206     // Add a "show" event listener for each submenu.
0207 
0208     function onSubmenuShow() {
0209 
0210         var oIFrame,
0211             oElement,
0212             nOffsetWidth;
0213 
0214 
0215         // Keep the left-most submenu against the left edge of the browser viewport
0216 
0217         if (this.id == "allgemein") {
0218 
0219             YAHOO.util.Dom.setX(this.element, 0);
0220 
0221             oIFrame = this.iframe;
0222 
0223 
0224             if (oIFrame) {
0225 
0226                 YAHOO.util.Dom.setX(oIFrame, 0);
0227 
0228             }
0229 
0230             this.cfg.setProperty("x", 0, true);
0231 
0232         }
0233 
0234 
0235         /*
0236          Need to set the width for submenus of submenus in IE to prevent the mouseout
0237          event from firing prematurely when the user mouses off of a MenuItem's
0238          text node.
0239          */
0240 
0241         if ((this.id == "filemenu" || this.id == "editmenu") && YAHOO.env.ua.ie) {
0242 
0243             oElement = this.element;
0244             nOffsetWidth = oElement.offsetWidth;
0245 
0246             /*
0247              Measuring the difference of the offsetWidth before and after
0248              setting the "width" style attribute allows us to compute the
0249              about of padding and borders applied to the element, which in
0250              turn allows us to set the "width" property correctly.
0251              */
0252 
0253             oElement.style.width = nOffsetWidth + "px";
0254             oElement.style.width = (nOffsetWidth - (oElement.offsetWidth - nOffsetWidth)) + "px";
0255 
0256         }
0257 
0258     }
0259 
0260 
0261     // Subscribe to the "show" event for each submenu
0262 
0263     oMenuBar.subscribe("show", onSubmenuShow);
0264 });