Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
fix(hooks): move ClientAreaPrimaryNavbar back into hooks.php
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiSchwarz-cnic committed Oct 9, 2019
1 parent ae5b452 commit 5583e78
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 33 deletions.
32 changes: 32 additions & 0 deletions hooks.php
@@ -0,0 +1,32 @@
<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) {
$key = "ispapibackorder";
$language = (isset($_SESSION["language"]) ? $_SESSION["language"] : "english");
$file = getcwd() . DIRECTORY_SEPARATOR . "modules" . DIRECTORY_SEPARATOR . "addons" . DIRECTORY_SEPARATOR . $key . DIRECTORY_SEPARATOR . "lang" . DIRECTORY_SEPARATOR . $language . ".php";
if (file_exists($file)) {
include($file);
}

$primaryNavbar->addChild($key, array(
"label" => $_ADDONLANG["backorder_nav"],
"uri" => "index.php?m={$key}&p=manage",
"order" => "70"
));

$pc = $primaryNavbar->getChild($key);
if (!is_null($pc)) {
$pc->addChild($key . "_manage", array(
"label" => $_ADDONLANG["managebackorders"],
"uri" => "index.php?m={$key}&p=manage",
"order" => "20"
));
$pc->addChild($key . "_droplist", array(
"label" => $_ADDONLANG["domainheader"],
"uri" => "index.php?m={$key}&p=dropdomains",
"order" => "10"
));
}
});
33 changes: 0 additions & 33 deletions ispapibackorder.php
Expand Up @@ -21,7 +21,6 @@
}

use WHMCS\Database\Capsule;
use WHMCS\View\Menu\Item as MenuItem;

function ispapibackorder_config()
{
Expand All @@ -36,8 +35,6 @@ function ispapibackorder_config()
return $configarray;
}



function ispapibackorder_activate()
{
try {
Expand Down Expand Up @@ -96,7 +93,6 @@ function ispapibackorder_activate()
}
}


function ispapibackorder_deactivate()
{
//DO NOT DELETE TABLES WHEN DEACTIVATING DOMAINS - DEVELOPPER HAS TO DO IT MANUALLY IF WANTED
Expand Down Expand Up @@ -161,35 +157,6 @@ function ispapibackorder_logs_content($modulelink)

function ispapibackorder_clientarea($vars)
{
add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) {
$key = "ispapibackorder";
$language = (isset($_SESSION["language"]) ? $_SESSION["language"] : "english");
$file = getcwd() . DIRECTORY_SEPARATOR . "modules" . DIRECTORY_SEPARATOR . "addons" . DIRECTORY_SEPARATOR . $key . DIRECTORY_SEPARATOR . "lang" . DIRECTORY_SEPARATOR . $language . ".php";
if (file_exists($file)) {
include($file);
}

$primaryNavbar->addChild($key, array(
"label" => $_ADDONLANG["backorder_nav"],
"uri" => "index.php?m={$key}&p=manage",
"order" => "70"
));

$pc = $primaryNavbar->getChild($key);
if (!is_null($pc)) {
$pc->addChild($key . "_manage", array(
"label" => $_ADDONLANG["managebackorders"],
"uri" => "index.php?m={$key}&p=manage",
"order" => "20"
));
$pc->addChild($key . "_droplist", array(
"label" => $_ADDONLANG["domainheader"],
"uri" => "index.php?m={$key}&p=dropdomains",
"order" => "10"
));
}
});

$modulename = "ispapibackorder";
$modulepath = "modules" . DIRECTORY_SEPARATOR . "addons" . DIRECTORY_SEPARATOR . $modulename;

Expand Down

0 comments on commit 5583e78

Please sign in to comment.