refine use of "return" in functions.php

* isInteger(): don't use "if" where a boolean expression does the job
* isPCRE(): idem
* ip_mask():idem
* getPrevIDforRack(): idem
* getNextIDforRack(): idem
* ip4_bin2db(): idem
* acceptable8021QConfig(): idem
* validTagName(): idem

* l2addressFromDatabase(): dismiss a useless intermediate variable
* getRackCodeStats(): idem
* makeIPTree(): idem
* getLocationTrail(): idem
address assorted style issues in functions.php

* rectHeight(): don't reinvent logical OR with multiple if()'s

* markSpan(): remove excess parentheses
* cookOptgroups(): idem
* alterConfigWithUserPreferences(): idem

* ip4_mask(): don't use "else" after "return"
* ip6_mask(): idem

* getRSUforRack(): wrap a long line
* getRSUforRow(): idem

* pokeNode(): put longer of two "if" branches into "else"
* iptree_construct(): idem

* prepareNavigation(): remove excess code

* shrinkSubtree(): add a missing newline
* isConfigVarChanged(): idem

* getEmployedVlans(): eliminate "else" near "continue"

* strerror8021Q: don't reinvent an array with a switch block
* formatRealmName(): idem
fixup "if" condition in pokeNode()
fix two more ternary conditionals in functions.php

Aaron points the last change to these functions made them reinvent "?:"
with "if". Fix.

* formatRealmName()
* strerror8021Q()
factor some sign/comparison code out

There is a number of use cases in the code for the sign (-1/0/1) value,
all implemented with nested ternary expressions. Factor two helper
functions out and make use of them

* numSign(): new function
* numCompare(): new function
* IPCmp(): use above
* compareDecomposedPortNames(): idem
* cmp_array_sizes(): idem
compareDecomposedPortNames: fix numCompare call
restore the FileLink table
syncdomain: don't do dummy SQL UPDATE's

don't update out-of-sync switch status each time when switch is disabled
LDAP caching refactored, code duplication removed

2-stage LDAP cache lookup to reduce unneeded INSERTs that cause the MySQL
binary log to grow rapidly.
1st stage: only the SELECT is performed. If it is a valid cache row, no
more locks/inserts occur.
2nd stage: we try to lock the existing/new cache row and validate it again.
If it fails, LDAP query is performed.

authenticated_via_ldap_cache: 2-stage cache lookup introduced, refactored.
fetchLDAPCacheRow: simple fetching function. The query was in acquireLDAPCache before
acquireLDAPCache: now it only makes lock on cache row (existing or new)
isLDAPCacheValid: check if cache row matches complex validity condition
replaceLDAPCacheRecord: does real replace, not update (resets refresh timeout)
touchLDAPCacheRecord: form_username argument renamed to username
deleteLDAPCacheRecord: idem
improve readability after 7bc5438

Streamline a number of ?: cases and make use of fetchColumn() where it
fits.

* getIPv4AddressNetworkId()
* fetchIPv4AddressNetworkRow()
* getIPv6AddressNetworkId()
* fetchIPv6AddressNetworkRow()
* objectTypeMayHaveParent()
* loadScript()
* getFileCache()
* findFileByName()
* getUserIDByUsername()
* getVLANSwitchInfo()
fix some space-indented lines with tabs
acquireLDAPCache: fix recursive function call
string_insert_hrefs: use preg_replace_callback() instead of preg_replace() with the /e modifier (deprecated, causes a warning with PHP 5.5)
StringInsertHrefsTest: unit test to validate string_insert_hrefs
StringInsertHrefsTest: use a dataProvider for the sample data
don't use argument by reference in doubleLink()

* doubleLink(): update to distinguish input and output data
* getPrevIDforRack(): use function superposition
* getNextIDforRack(): idem
* getProximateRacks(): idem
factor array_fetch() out

There is no core function in PHP that would return a default value when
there is no requested index in the array (consider Array.fetch() in
Ruby). Implement and use such function to replace a few ternary
conditionals with a more focused notation.

* array_fetch(): new function
* syncdomain.php: update
* getPrevIDforRack(): idem
* getNextIDforRack(): idem
* formatRealmName(): idem
* get8021QSyncOptions(): idem
* strerror8021Q(): idem
* renderObject8021QPorts(): idem
* renderObject8021QSyncPorts(): idem
* resolve8021QConflicts(): idem
* tableHandler(): idem
SNMP: list HP J9085A (2610-24)
fix bug I've added in syncdomain.php
commitUpdateAttrValue: don't make dummy SQL UPDATE
refine use of "return" in isInnoDBSupported()