]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/helper/web/links/class_WebLinkHelper.php
State (see State Pattern) prepared, a lot reworked/refactured
[core.git] / inc / classes / main / helper / web / links / class_WebLinkHelper.php
index 5b4a9220e04eb1e364214228ad8e43dec0993805..69eeb7e9983aed05db70acbea24f5bd8c68b624d 100644 (file)
@@ -59,7 +59,6 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
         * @param       $linkName                       Name of the link we shall generate
         * @param       $linkBase                       Link base for the link. This parameter is deprecated.
         * @return      $helperInstance         A prepared instance of this helper
-        * @throws      NullPointerException    Thrown if an instance is null
         * @throws      ConfigEntryNotFoundException    A deprecated exception at this point
         */
        public final static function createWebLinkHelper (CompileableTemplate $templateInstance, $linkName, $linkBase = null) {
@@ -75,12 +74,6 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
                // Get the application instance
                $applicationInstance = Registry::getRegistry()->getInstance('application');
 
-               // Sanity-check on it
-               if (is_null($applicationInstance)) {
-                       // Throw an exception here
-                       throw new NullPointerException($helperInstance, self::EXCEPTION_IS_NULL_POINTER);
-               } // END - if
-
                // Get the request instance
                $requestInstance = $applicationInstance->getRequestInstance();
 
@@ -94,12 +87,12 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
                $page = $helperInstance->convertDashesToUnderscores($requestInstance->getRequestElement('page'));
 
                // Construct config entry
-               $configEntry = $page . '_' . $linkName;
+               $configEntry = $page . '_' . $linkName . '_action_url';
 
                // Is the deprecated parameter set?
                if (!is_null($linkBase)) {
                        // Then output a deprecation message
-                       $helperInstance->deprecationWarning(__METHOD__ . ': linkBase is deprecated. Please remove it from your templates and add a config entry ' . $configEntry . '_action in your config.php file.');
+                       $helperInstance->deprecationWarning(__METHOD__ . ': linkBase is deprecated. Please remove it from your templates and add a config entry ' . $configEntry . ' in your config.php file.');
                } // END - if
 
                // Determine link base from config now and 'page' request