factor array_fetch() out
authorDenis Ovsienko <infrastation@yandex.ru>
Mon, 16 Dec 2013 16:44:30 +0000 (20:44 +0400)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 16 Dec 2013 16:52:57 +0000 (20:52 +0400)
commita4c3d979de18df698a80194e6f66c0a284485acd
tree3bbee69ca1c4e6c32e16b4acc2021ede165fd4ff
parent9f59fca04ac37063568b84acb75242af2621883d
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
scripts/syncdomain.php
wwwroot/inc/functions.php
wwwroot/inc/interface.php
wwwroot/inc/ophandlers.php