]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/helper/web/links/class_WebLinkHelper.php
Code cleanups, deprecated classes renamed
[core.git] / inc / classes / main / helper / web / links / class_WebLinkHelper.php
index bbec50a6f9fe28e2180859a31acb32db8e49a7c7..c09de55ec0fb456253bbea09ba6473901ebf8982 100644 (file)
@@ -59,8 +59,7 @@ 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
+        * @throws      NoConfigEntryException  A deprecated exception at this point
         */
        public final static function createWebLinkHelper (CompileableTemplate $templateInstance, $linkName, $linkBase = null) {
                // Get new instance
@@ -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,7 +87,7 @@ 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)) {
@@ -104,13 +97,13 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
 
                // Determine link base from config now and 'page' request
                try {
-                       $newLinkBase = $helperInstance->getConfigInstance()->readConfig($configEntry);
+                       $newLinkBase = $helperInstance->getConfigInstance()->getConfigEntry($configEntry);
                        $linkBase = $newLinkBase;
-               } catch (ConfigEntryNotFoundException $e) {
+               } catch (NoConfigEntryException $e) {
                        // Is the deprecated linkBase not set?
                        if (is_null($linkBase)) {
                                // Then throw again the exception
-                               throw new ConfigEntryNotFoundException(array(__CLASS__, ($configEntry)), self::EXCEPTION_CONFIG_ENTRY_WAS_NOT_FOUND);
+                               throw new NoConfigEntryException(array(__CLASS__, ($configEntry)), FrameworkConfiguration::EXCEPTION_CONFIG_ENTRY_WAS_NOT_FOUND);
                        } // END - if
                }