]> git.mxchange.org Git - friendica.git/commitdiff
Increase the page load speed with Frio
authorMichael <heluecht@pirati.ca>
Wed, 7 Jun 2017 19:51:37 +0000 (19:51 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 7 Jun 2017 19:51:37 +0000 (19:51 +0000)
include/acl_selectors.php
view/theme/frio/theme.php

index c7c6bb206aaf5a6d12ba1940792e9657586ee90e..9ef1977bc5fd68d83f025383f4a52331451e19fe 100644 (file)
@@ -389,6 +389,13 @@ function populate_acl($user = null, $show_jotnets = false) {
 
 function construct_acl_data(App $a, $user) {
 
+       $arr = array('user' => $user);
+       call_hooks('construct_acl_data', $arr);
+
+       if (isset($arr['cancel'])) {
+               return;
+       }
+
        // Get group and contact information for html ACL selector
        $acl_data = acl_lookup($a, 'html');
 
index 551f39c8f78b560155a94d4ba25ef46e4c9b6cfd..cbb7324bcbdc365a46f1dd15f25a1b01fd3d17fc 100644 (file)
@@ -48,6 +48,7 @@ function frio_install() {
        register_hook('contact_photo_menu', 'view/theme/frio/theme.php', 'frio_contact_photo_menu');
        register_hook('nav_info', 'view/theme/frio/theme.php', 'frio_remote_nav');
        register_hook('acl_lookup_end', 'view/theme/frio/theme.php', 'frio_acl_lookup');
+       register_hook('construct_acl_data', 'view/theme/frio/theme.php', 'frio_construct_acl_data');
 
        logger("installed theme frio");
 }
@@ -58,6 +59,7 @@ function frio_uninstall() {
        unregister_hook('contact_photo_menu', 'view/theme/frio/theme.php', 'frio_contact_photo_menu');
        unregister_hook('nav_info', 'view/theme/frio/theme.php', 'frio_remote_nav');
        unregister_hook('acl_lookup_end', 'view/theme/frio/theme.php', 'frio_acl_lookup');
+       unregister_hook('construct_acl_data', 'view/theme/frio/theme.php', 'frio_construct_acl_data');
 
        logger("uninstalled theme frio");
 }
@@ -321,3 +323,15 @@ function frio_acl_lookup(App $a, &$results) {
                $results["tot"] = $total;
        }
 }
+
+/**
+ * @brief: Deactivate the old style acl selector
+ *
+ * We don't need the old one for Frio. Deactivating makes page loading much faster
+ *
+ * @param App $a The app data @TODO Unused
+ * @param array $arr We use this array to stop processing. See construct_acl_data in include/acl_selectors.php
+ */
+function frio_construct_acl_data(App $a, &$arr) {
+       $arr['cancel'] = true;
+}