Forráskód Böngészése

extend UI & Pages

andre 2 éve
szülő
commit
78a824be2c

+ 7 - 4
app/Config/sidebars.yml

@@ -5,12 +5,15 @@ management:
   emailAlias:
     order: 720
     uri: 'clientarea.php?action=productdetails&id={$hostingId}&modop=custom&a=management&mg-page=emailAlias'
+  ressource:
+    order: 730
+    uri: 'clientarea.php?action=productdetails&id={$hostingId}&modop=custom&a=management&mg-page=ressource'
   distributionList:
-      order: 730
-      uri: 'clientarea.php?action=productdetails&id={$hostingId}&modop=custom&a=management&mg-page=distributionList'
-  domainAlias:
     order: 740
+    uri: 'clientarea.php?action=productdetails&id={$hostingId}&modop=custom&a=management&mg-page=distributionList'
+  domainAlias:
+    order: 750
     uri: 'clientarea.php?action=productdetails&id={$hostingId}&modop=custom&a=management&mg-page=domainAlias'
   goWebmail:
-    order: 750
+    order: 760
     uri: 'clientarea.php?action=productdetails&id={$hostingId}&modop=custom&a=management&mg-page=webmail" target="_blank'

+ 1 - 0
app/Enums/ControllerEnums.php

@@ -18,5 +18,6 @@ class ControllerEnums
     const DOMAIN_ALIAS_PAGE         = 'ca_domainAliasesPage';
     const WEBMAIL_PAGE              = 'ca_goToWebmailPage';
     const DISTRIBUTION_MAIL_PAGE    = 'ca_distributionListPage';
+    const RESSOURCE_PAGE            = 'ca_ressourcePage';
 
 }

+ 1 - 1
app/Http/Client/Ressource.php

@@ -29,7 +29,7 @@ class Ressource extends AbstractClientController
         $productManager = new ProductManager();
         $productManager->loadByHostingId($this->request->get('id'));
 
-        if ($this->getWhmcsParamByKey('status') !== 'Active' || !$productManager->isControllerAccessible(ControllerEnums::EMAIL_ACCOUNT_PAGE))
+        if ($this->getWhmcsParamByKey('status') !== 'Active' || !$productManager->isControllerAccessible(ControllerEnums::RESSOURCE_PAGE))
         {
             return Helper\redirectByUrl(BuildUrlExtended::getProvisioningUrl('',false,false));
         }

+ 1 - 0
app/Libs/Migrations/Drivers/Version1To2/Settings.php

@@ -177,6 +177,7 @@ class Settings
         return [
             'clientAreaFeaturesLeft'    => 'on',
             'ca_emailAccountPage'       => 'on',
+            'ca_ressourcePage'          => 'on',
             'ca_distributionListPage'   => 'on',
             'ca_goToWebmailPage'        => 'on',
             'clientAreaFeaturesRight'   => 'on',

+ 3 - 0
app/Libs/Product/ProductManager.php

@@ -260,6 +260,9 @@ class ProductManager
             case 'emailAlias':
                 $controller = ControllerEnums::EMAIL_ALIAS_PAGE;
                 break;
+            case 'ressource':
+                $controller = ControllerEnums::RESSOURCE_PAGE;
+                break;
             case 'distributionList':
                 $controller = ControllerEnums::DISTRIBUTION_MAIL_PAGE;
                 break;

+ 3 - 0
app/UI/Admin/ProductConfiguration/Pages/Sections/ClientAreaFeatures.php

@@ -45,6 +45,9 @@ class ClientAreaFeatures extends BoxSectionExtended implements AdminArea
         $field = new Switcher('ca_goToWebmailPage');
         $leftSection->addField($field);
 
+        $field = new Switcher('ca_ressourcePage');
+        $leftSection->addField($field);
+
         return $leftSection;
 
     }

+ 1 - 0
app/UI/Admin/ProductConfiguration/Providers/ProductConfigurationDataProvider.php

@@ -43,6 +43,7 @@ class ProductConfigurationDataProvider extends BaseDataProvider implements Admin
             'domainBaseSize',
             'cos',
             'ca_emailAccountPage',
+            'ca_ressourcePage',
             'ca_distributionListPage',
             'ca_goToWebmailPage',
             'ca_emailAliasesPage',

+ 11 - 0
app/UI/Client/Home/Pages/Dashboard.php

@@ -63,6 +63,17 @@ class Dashboard extends BaseContainer implements ClientArea
             $this->addFeature($feature);
         }
 
+        /**
+         *
+         * check if ressource page is enabled
+         */
+        if($productManager->isControllerAccessible(ControllerEnums::RESSOURCE_PAGE))
+        {
+            $feature = new FeatureField('ressource');
+            $feature->setUrl(BuildUrlExtended::getProvisioningUrl('ressource'));
+            $this->addFeature($feature);
+        }
+
         /**
          *
          * check if distribution list page is enabled