rabijit Posted January 10, 2016 Share Posted January 10, 2016 Hello Everyone, I rendered a custom sidebar using the code below, add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $PrimarySidebar) { if (intval($_SESSION['uid'])==0){ return; } $PrimarySidebar->addChild('dashboard', array( 'label' => 'Quick Links', 'uri' => '#', 'icon' => 'fa-bars', 'order'=> 2, )); $dashboardPanel = $PrimarySidebar->getChild('dashboard'); $dashboardPanel->addChild('Dashboard', array( 'uri' => 'clientarea.php', 'label' => 'Dashboard', 'order' => 2, 'icon' => 'fa-tachometer', )); $dashboardPanel->addChild('My Services', array( 'uri' => 'clientarea.php?action=services', 'label' => 'My Services', 'order' => 3, 'icon' => 'fa-server', )); $dashboardPanel->addChild('My Domains', array( 'uri' => 'clientarea.php?action=domains', 'label' => 'My Domains', 'order' => 4, 'icon' => 'fa-globe', )); $dashboardPanel->addChild('Invoices', array( 'uri' => 'clientarea.php?action=invoices', 'label' => 'My invoices', 'order' => 5, 'icon' => 'fa-credit-card', )); $dashboardPanel->addChild('Tickets', array( 'uri' => 'supporttickets.php', 'label' => 'Support Tickets', 'order' => 6, 'icon' => 'fa-ticket', )); }); It works perfectly, appears to clients after login but also appear in domainchecker.php also how to remove this sidebar in domainchecker.php for loggedin users Thanks is advance 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted January 10, 2016 Share Posted January 10, 2016 we need to add additional condition add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $PrimarySidebar) { if (intval($_SESSION['uid'])==0 || APP::getCurrentFileName()=="domainchecker"){ return; } $PrimarySidebar->addChild('dashboard', array( 'label' => 'Quick Links', 'uri' => '#', 'icon' => 'fa-bars', 'order'=> 2, )); $dashboardPanel = $PrimarySidebar->getChild('dashboard'); $dashboardPanel->addChild('Dashboard', array( 'uri' => 'clientarea.php', 'label' => 'Dashboard', 'order' => 2, 'icon' => 'fa-tachometer', )); $dashboardPanel->addChild('My Services', array( 'uri' => 'clientarea.php?action=services', 'label' => 'My Services', 'order' => 3, 'icon' => 'fa-server', )); $dashboardPanel->addChild('My Domains', array( 'uri' => 'clientarea.php?action=domains', 'label' => 'My Domains', 'order' => 4, 'icon' => 'fa-globe', )); $dashboardPanel->addChild('Invoices', array( 'uri' => 'clientarea.php?action=invoices', 'label' => 'My invoices', 'order' => 5, 'icon' => 'fa-credit-card', )); $dashboardPanel->addChild('Tickets', array( 'uri' => 'supporttickets.php', 'label' => 'Support Tickets', 'order' => 6, 'icon' => 'fa-ticket', )); }); 0 Quote Link to comment Share on other sites More sharing options...
rabijit Posted January 10, 2016 Author Share Posted January 10, 2016 Thank you @sentq you made my day 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.