X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fhelper%2Fweb%2Flinks%2Fclass_WebLinkHelper.php;h=3f97b4a84a1c688e833272250d2c5c3bfffae353;hp=a1e628174aa5698edb99138b784d02fc4edb1f69;hb=fdc6a02b5e6c2155cda61fcc345c7583b734ab85;hpb=84e2207412d3c6ea9f940a83b2cdd4503509808a diff --git a/inc/classes/main/helper/web/links/class_WebLinkHelper.php b/inc/classes/main/helper/web/links/class_WebLinkHelper.php index a1e62817..3f97b4a8 100644 --- a/inc/classes/main/helper/web/links/class_WebLinkHelper.php +++ b/inc/classes/main/helper/web/links/class_WebLinkHelper.php @@ -2,11 +2,11 @@ /** * A helper for web links * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Core Developer Team * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.shipsimu.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,14 +33,14 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { private $linkBase = ''; /** - * First parameter seperator + * First parameter separator */ - private $firstParameter = '?'; + const FIRST_PARAMETER_SEPARATOR = '?'; /** - * Seperator for more paraemters + * SEPARATOR for more paraemters */ - private $parameterSeperator = '&'; + const EXTRA_PARAMETER_SEPARATOR = '&'; /** * Protected constructor @@ -61,7 +61,7 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { * @return $helperInstance A prepared instance of this helper * @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(); @@ -92,7 +92,7 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { // 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 @@ -239,7 +239,7 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { */ public function addLinkNote ($groupId, $groupNote, $groupCode = "div") { // Check if a previous group was opened - if ($this->ifGroupOpenedPreviously() === false) { + if ($this->ifGroupOpenedPreviously() === FALSE) { // No group was opened before! throw new NoGroupOpenedException(array($this, $groupNote), self::EXCEPTION_GROUP_NOT_OPENED); } // END - if @@ -271,24 +271,24 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { */ protected function addActionLink ($linkAction, $linkText, $linkTitle) { // Check if a previous group was opened - if ($this->ifGroupOpenedPreviously() === false) { + if ($this->ifGroupOpenedPreviously() === FALSE) { // No group was opened before! throw new NoGroupOpenedException(array($this, $linkAction . '(' . $linkText . ')'), self::EXCEPTION_GROUP_NOT_OPENED); } // END - if - // Default parameter seperator is & - $seperator = $this->parameterSeperator; + // Default parameter SEPARATOR is & + $separator = self::EXTRA_PARAMETER_SEPARATOR; // Is there a question mark in? - $linkArray = explode($this->firstParameter, $this->getLinkBase()); + $linkArray = explode(self::FIRST_PARAMETER_SEPARATOR, $this->getLinkBase()); if (count($linkArray) == 0) { // No question mark - $seperator = $this->firstParameter; + $separator = self::FIRST_PARAMETER_SEPARATOR; } // END - if // Prepare action $action = sprintf("%saction=%s", - $seperator, + $separator, $linkAction );