MediaWiki añadía <pre> alrededor de los <a>, los <div> de dentro
authorWikimedia Espana <wmes@canberra>
Sat, 7 Jul 2012 14:58:31 +0000 (07:58 -0700)
committerWikimedia Espana <wmes@canberra>
Sat, 7 Jul 2012 14:58:31 +0000 (07:58 -0700)
de los <a> se mostraban como texto, ocultar el título, mover las
cajas a la función landingbox().

HomePageWMES.php

index d58296b7e3c3808294e2c084d0d0e02893a828c4..8e054fd0a81d72c9ac9677132ef58bfd341d23f7 100644 (file)
@@ -20,66 +20,46 @@ function efSetupHomepageWMES(&$parser) {
   $parser->setHook( 'Portada', 'efHookHomepageWMES' );\r
   return true;\r
 }\r
+\r
+function landingbox($nombre, $class, $texto, $enlace2, $titulo2) {                           \r
+  global $wgExtensionAssetsPath;\r
+                $nombre = htmlspecialchars( $nombre );\r
+                $imagen = "$wgExtensionAssetsPath/HomePageWMES/images/home/" . $nombre . ".png";\r
+                $link = "/" . lcfirst( $nombre );\r
+                $boxname = strtolower( $nombre ) . "_box";\r
+\r
+   return   "<div class=\"content_landingbox\">\r
+                <div class=\"$boxname\">" .\r
+                  '<div class="landingbox" style="background: url(' . "'$imagen'" . ') repeat 100% 100%; height:133px;width:319px;">' .\r
+                    "<a class=\"link$class\" href=\"$link\" title=\"$nombre\">" .\r
+                      "<h3 class=\"landingbox_title\">" . rtrim( $nombre, 'r' ) . "</h3>" .\r
+                    "</a>" .\r
+                    "<a class=\"link landingbox_more\" href=\"$link\" title=\"$nombre\">" .\r
+                      '<p>MÁS</p>' . \r
+                    '</a>' . \r
+                    "<a class=\"link$class\" href=\"$enlace2\" title=\"$titulo2\">" .\r
+                      "<p class=\"landingbox_body\">$texto</p>" .\r
+                    '</a>' .\r
+                  '</div>\r
+                </div>\r
+              </div>';\r
+}\r
+\r
     \r
 function efHookHomepageWMES( $input, array $args, Parser $parser, PPFrame $frame ) {\r
-      return <<<HTML\r
-        <div class="dm_zones clearfix">\r
+      global $wgOut;\r
+      $wgOut->addInlineStyle('h1 { display: none }'); // FIXME\r
+      \r
+      return\r
+        '<div class="dm_zones clearfix">\r
           <div class="dm_zone landingboxes_left" style="width: 320px;">\r
-            <div class="dm_widgets">\r
-              <div class="content_landingbox">\r
-                <div class="actividades_box">\r
-                  <div class="landingbox" style="background: url('/wp-content/themes/wmes-theme/images/home/Actividades.png') repeat 100% 100%; height:133px;width:319px;">\r
-                    <a class="link" href="/actividades" title="Actividades">\r
-                      <h3 class="landingbox_title">Actividades</h3>\r
-                    </a>\r
-                    <a class="link" href="/actividades" title="Actividades">\r
-                      <div class="landingbox_more">\r
-                        <p>MÁS</p>\r
-                      </div>\r
-                    </a>\r
-                    <a class="link" href="http://wlm.wikimedia.org.es/" title="WLM">\r
-                      <p class="landingbox_body">Wiki Loves Monuments<br/>Concurso europeo de fotos</p>\r
-                    </a>\r
-                  </div>\r
-                </div>\r
-              </div>\r
-              <div class="content_landingbox">\r
-                <div class="participa_box">\r
-                  <div class="landingbox" style="background: url(/wp-content/themes/wmes-theme/images/home/Participa.png) repeat 100% 100%; height:133px;width:319px;">\r
-                    <a class="link whitelink" href="/participa" title="Participa">\r
-                      <h3 class="landingbox_title">Participa</h3>\r
-                    </a>\r
-                    <a class="link" href="/participa" title="Participa">\r
-                      <div class="landingbox_more">\r
-                        <p>MÁS</p>\r
-                      </div>\r
-                    </a>\r
-                    <a class="link whitelink" href="/participa" title="Participa">\r
-                      <p class="landingbox_body">Descubre cómo<br/>puedes colaborar\r
-                      </p>\r
-                    </a>\r
-                  </div>\r
-                </div>\r
-              </div>\r
-              <div class="content_landingbox">\r
-                <div class="donar_box">\r
-                  <div class="landingbox" style="background: url(/wp-content/themes/wmes-theme/images/home/Donar.png) repeat 100% 100%; height:133px;width:319px;">\r
-                    <a class="link" href="/donar" title="Donar">\r
-                      <h3 class="landingbox_title">Dona</h3>\r
-                    </a>\r
-                    <a class="link" href="/donar" title="Donar">\r
-                      <div class="landingbox_more">\r
-                        <p>MÁS</p>\r
-                      </div>\r
-                    </a>\r
-                    <a class="link" href="/donar" title="Donar">\r
-                      <p class="landingbox_body">Tus donaciones<br/>sostienen Wikimedia\r
-                      </p>\r
-                    </a>\r
-                  </div>\r
-                </div>\r
-              </div>\r
-            </div>\r
+            <div class="dm_widgets">' . \r
+            \r
+           landingbox("Actividades", '', 'Wiki Loves Monuments<br/>Concurso europeo de fotos', 'http://wlm.wikimedia.org.es/', 'WLM') . \r
+           landingbox("Participa", ' whitelink', 'Descubre cómo<br/>puedes colaborar') . \r
+           landingbox("Donar", '', "Tus donaciones<br/>sostienen Wikimedia") .\r
+           \r
+            '</div>\r
           </div>\r
           <div class="dm_zone landingboxes_right" style="width: 602px;">\r
             <div class="dm_widgets">\r
@@ -133,27 +113,19 @@ function efHookHomepageWMES( $input, array $args, Parser $parser, PPFrame $frame
                     \r
                   </div>\r
                 </div>\r
-              </div>\r
-              <div class="dm_widget content_landingbox">\r
+              </div>' .\r
+              '<div class="dm_widget content_landingbox">\r
                 <div class="dm_widget_inner prensa_box">\r
-                  <div class="landingbox" style="background: url(/wp-content/themes/wmes-theme/images/home/Prensa.png) repeat 100% 100%; height:81px;width:602px;">\r
-                    <a class="link" href="/blog" title="Blog">\r
-                      <h3 class="landingbox_title">Blog</h3>\r
-                    </a>\r
-                    <a class="link" href="/blog" title="Blog">\r
-                      <div class="landingbox_more">\r
-                        <p>MÁS</p>\r
-                      </div>\r
-                    </a>\r
-                    <a class="link" href="/blog" title="Blog">\r
-                      <p class="landingbox_body">Artículos y noticias<br/>sobre conocimiento libre</p>\r
-                    </a>\r
-                  </div>\r
+                  <div class="landingbox" style="background: url(/wp-content/themes/wmes-theme/images/home/Prensa.png) repeat 100% 100%; height:81px;width:602px;">' .\r
+                    '<a class="link" href="/blog" title="Blog"><h3 class="landingbox_title">Blog</h3></a>' . \r
+                    '<a class="link landingbox_more" href="/blog" title="Blog"><p>MÁS</p></a>' . \r
+                    '<a class="link" href="/blog" title="Blog"><p class="landingbox_body">Artículos y noticias<br/>sobre conocimiento libre</p></a>' . \r
+                  '</div>\r
                 </div>\r
               </div>\r
             </div>\r
-          </div>\r
-HTML\r
+          </div>'\r
+\r
 /*\r
          <div class="posts_wrapper clear">\r
 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>\r