*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
/**
* First parameter seperator
*/
- private $firstParameter = '?';
+ const FIRST_PARAMETER_SEPERATOR = '?';
/**
* Seperator for more paraemters
*/
- private $parameterSeperator = '&';
+ const EXTRA_PARAMETER_SEPERATOR = '&';
/**
* Protected constructor
* @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 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) {
+ public static final function createWebLinkHelper (CompileableTemplate $templateInstance, $linkName, $linkBase = NULL) {
// Get new instance
$helperInstance = new WebLinkHelper();
// 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 . ' in your config.php file.');
+ $helperInstance->deprecationWarning('[' . __METHOD__ . ':' . __LINE__ . ']: 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
try {
$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)), FrameworkConfiguration::EXCEPTION_CONFIG_ENTRY_WAS_NOT_FOUND);
+ throw new NoConfigEntryException(array(__CLASS__, ($configEntry)), FrameworkConfiguration::EXCEPTION_CONFIG_ENTRY_WAS_NOT_FOUND);
} // END - if
}
} // END - if
// Default parameter seperator is &
- $seperator = $this->parameterSeperator;
+ $seperator = self::EXTRA_PARAMETER_SEPERATOR;
// Is there a question mark in?
- $linkArray = explode($this->firstParameter, $this->getLinkBase());
+ $linkArray = explode(self::FIRST_PARAMETER_SEPERATOR, $this->getLinkBase());
if (count($linkArray) == 0) {
// No question mark
- $seperator = $this->firstParameter;
+ $seperator = self::FIRST_PARAMETER_SEPERATOR;
} // END - if
// Prepare action