hostnet Posted July 3, 2021 Share Posted July 3, 2021 Hi? I'm creating a hook to present a customer contract page. i created a widjet hook in the menu, i created the page php file and everything seems to be fine. however I have doubts and I need help to know the reason that the widjet is moving below the content and not fixed on the sidel. <?php use WHMCS\View\Menu\Item as MenuItem; if (App::getCurrentFilename() == 'clientarea') add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar) { $client = Menu::context('client'); // Linha ADD if (!is_null($client)) { // Linha ADD $secondarySidebar->addChild('social-media', array( 'label' => 'Dados e Contratos', 'uri' => '#', 'icon' => 'far fa-file-pdf', )); $socialMediaPanel = $secondarySidebar->getChild('social-media'); $socialMediaPanel->moveToBack(); $socialMediaPanel->addChild('site-link', array( 'uri' => 'https://www.hostcuritiba.net.br/painel/contrato.php', 'label' => 'Acesso ao Contrato', 'order' => 1, 'icon' => 'fa-globe fa-fw', )); } // Linha ADD }); ============ <?php use WHMCS\ClientArea; use WHMCS\Database\Capsule; define('CLIENTAREA', true); require __DIR__ . '/init.php'; $ca = new ClientArea(); $ca->setPageTitle('Contrato de Prestação de Serviços Titular'); $ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname')); $ca->addToBreadCrumb('contrato.php', 'Contrato de Prestação de Serviços Titular'); $ca->initPage(); $ca->requireLogin(); // Uncomment this line to require a login to access this page // To assign variables to the template system use the following syntax. // These can then be referenced using {$variablename} in the template. //$ca->assign('variablename', $value); // Check login status if ($ca->isLoggedIn()) { /** * User is logged in - put any code you like here * * Here's an example to get the currently logged in clients first name */ $clientName = Capsule::table('tblclients') ->where('id', '=', $ca->getUserID())->pluck('firstname'); // 'pluck' was renamed within WHMCS 7.0. Replace it with 'value' instead. // ->where('id', '=', $ca->getUserID())->value('firstname'); $ca->assign('clientname', $clientName); } else { // User is not logged in $ca->assign('clientname', 'Random User'); } Menu::primarySidebar('announcementList'); Menu::secondarySidebar('announcementList'); # Define the template filename to be used without the .tpl extension $ca->setTemplate('contrato'); $ca->output(); 0 Quote Link to comment Share on other sites More sharing options...
hostnet Posted July 3, 2021 Author Share Posted July 3, 2021 here is the final result. I'm going to add an image because the page is just for login. 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.