From: Daniel Friesen Date: Tue, 7 Dec 2010 15:02:51 +0000 (+0000) Subject: Reduce code duplication in Vector by combining portal markup generation into a single... X-Git-Tag: 1.31.0-rc.0~33479 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=4cd4fa3e2050c0b6ff18ca3989add8c25f68c5cb;p=lhc%2Fweb%2Fwiklou.git Reduce code duplication in Vector by combining portal markup generation into a single method. --- diff --git a/skins/Vector.php b/skins/Vector.php index bf970d90c9..08ba5281f9 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -587,62 +587,51 @@ class VectorTemplate extends BaseTemplate { case 'SEARCH': break; case 'TOOLBOX': -?> -
- html('userlangattributes') ?>>msg( 'toolbox' ) ?> -
-
    -getToolbox() as $key => $tbitem ): ?> - makeListItem($key, $tbitem); ?> - - -
-
-
-renderPortal( "tb", $this->getToolbox(), "toolbox", "SkinTemplateToolboxEnd" ); break; case 'LANGUAGES': if ( $this->data['language_urls'] ) { -?> -
- html('userlangattributes') ?>>msg( 'otherlanguages' ) ?> -
-
    - data['language_urls'] as $key => $langlink ): ?> - makeListItem($key, $langlink); ?> - - -
-
-
-renderPortal("lang", $this->data['language_urls'], "otherlanguages"); } break; default: -?> + $this->renderPortal($name, $content); + break; + } + echo "\n\n"; + } + } + + private function renderPortal($name, $content, $msg=null, $hook=null) { + if ( !isset($msg) ) { + $msg = $name; + } + ?>
skin->tooltip( 'p-' . $name ) ?>> - html('userlangattributes') ?>> + html('userlangattributes') ?>>
- +
    - $val ): ?> + $val ): ?> makeListItem($key, $val); ?> - +
- + - +
\n"; - } } /**