lat9 / usu

Ultimate SEO URLs for Zen Cart
GNU General Public License v3.0
1 stars 5 forks source link

Enable additional customizations via notifications #44

Closed lat9 closed 1 year ago

lat9 commented 3 years ago

Some installations of USU have additional customizations. Add notifications at various points to enable these integrations.

For instance, this (in the constructor) would be a start

        // -----
        // Give a watching observer the opportunity to add additional 'anchors'
        // to the mix.  The array, on return should be an associative array
        // where the array element's key is the $_GET variable name and the associated
        // value identifies the query-string element to which it maps (just like the
        // as-shipped values above).
        //
        $additional_anchors = array();
        $this->notify('NOTIFY_USU_ADDITIONAL_ANCHORS', '', $additional_anchors);
        if (!empty($additional_anchors) && is_array($additional_anchors)) {
            $this->log('--> Additional anchors supplied via observer:' . json_encode($additional_anchors));
            $this->reg_anchors = array_merge($this->reg_anchors, $additional_anchors);
        }