<div>Victor y amigos de reddes,</div><div><br></div><div>Hemos identificado y corrigido un problema en el plugin de multi-language que no permitia el display de las páginas secundarias. </div><div><br></div><div>Es importante actualizar el plugin para poder trabajar con las paginas secundarias generadas en el plugin de BVS-Site.</div>
<div><br></div><div><br></div><div>Abrazos,</div><br clear="all"><span style="font-family:Arial;font-size:13px">Vinicius de Andrade<br><span><font style="font-size:11px"><b>BIREME/OPAS/OMS</b></font></span></span><br>
<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername"></b> <span dir="ltr"><<a href="mailto:noreply@wordpress.org">noreply@wordpress.org</a>></span><br>Date: Fri, Sep 2, 2011 at 4:44 PM<br>
Subject: [WordPress Plugin][432518] multi-language-framework/trunk: [fix] parse query for child pages<br>To: <a href="mailto:vinicius.andrade@bireme.org">vinicius.andrade@bireme.org</a><br><br><u></u>
<div>
<div>
<dl>
<dt><span class="Apple-style-span" style="font-size: 15px; font-weight: bold; ">Log Message</span></dt></dl>
<pre>[fix] parse query for child pages
[fix] page translation supports page attributes</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#1322bab9705df703_multilanguageframeworktrunkparse_queryphp">multi-language-framework/trunk/parse_query.php</a></li>
<li><a href="#1322bab9705df703_multilanguageframeworktrunkpost_typesphp">multi-language-framework/trunk/post_types.php</a></li>
</ul>
</div>
<div>
<h3>Diff</h3>
<a></a>
<div><h4>Modified: multi-language-framework/trunk/parse_query.php (432517 => 432518)</h4>
<pre><span>
<span>--- multi-language-framework/trunk/parse_query.php        2011-09-02 19:41:05 UTC (rev 432517)
+++ multi-language-framework/trunk/parse_query.php        2011-09-02 19:44:16 UTC (rev 432518)
</span><span>@@ -37,15 +37,19 @@
</span><span> // because we changed the REQUEST_URI so it doesnt know
</span><span> if ($wp_query->query_vars['pagename']) {
</span><span>
</span><ins>+ //lets check if there are slashes in the page name, that means a child
+ $pagename = $wp_query->query_vars['pagename'];
+ $pagename = str_replace( dirname($pagename) . '/', '', $pagename);
+
</ins><span> global $wpdb;
</span><span>
</span><del>- $post_type = $wpdb->get_var( $wpdb->prepare("SELECT post_type FROM $wpdb->posts WHERE post_name = %s", $wp_query->query_vars['pagename']) );
</del><ins>+ $post_type = $wpdb->get_var( $wpdb->prepare("SELECT post_type FROM $wpdb->posts WHERE post_name = %s", $pagename) );
</ins><span>
</span><span> $wp_query->query_vars['post_type'] = $post_type;
</span><span> //$wp_query->query_vars['post_type'] = $post_type . '_t_' . $mlf_config['current_language'];
</span><del>- $wp_query->query_vars['name'] = $wp_query->query_vars['pagename'];
</del><ins>+ $wp_query->query_vars['name'] = $pagename;
</ins><span> $wp_query->query_vars[$wp_query->query_vars['post_type']] = $wp_query->query_vars['name'];
</span><del>- $wp_query->query_vars['pagename'] = '';
</del><ins>+ $pagename = '';
</ins><span> $wp_query->is_page = false;
</span><span> $wp_query->is_single = true;
</span><span>
</span><span>@@ -54,7 +58,7 @@
</span><span>
</span><span> 'post_type' => $post_type,
</span><span> //'post_type' => $post_type . '_t_' . $mlf_config['current_language'],
</span><del>- 'name' => $wp_query->query_vars['pagename'],
</del><ins>+ 'name' => $pagename,
</ins><span> $wp_query->query_vars['post_type'] => $wp_query->query_vars['name']
</span><span>
</span><span> );
</span></span></pre></div>
<a></a>
<div><h4>Modified: multi-language-framework/trunk/post_types.php (432517 => 432518)</h4>
<pre><span>
<span>--- multi-language-framework/trunk/post_types.php        2011-09-02 19:41:05 UTC (rev 432517)
+++ multi-language-framework/trunk/post_types.php        2011-09-02 19:44:16 UTC (rev 432518)
</span><span>@@ -28,12 +28,15 @@
</span><span>
</span><span> case 'post':
</span><span> $menu_pos = 5;
</span><ins>+ $p_type_supports = array('title','editor','author','thumbnail','excerpt','comments');
</ins><span> break;
</span><span> case 'page':
</span><span> $menu_pos = 20;
</span><ins>+ $p_type_supports = array('title','editor','author','thumbnail','excerpt','comments', 'page-attributes');
</ins><span> break;
</span><span> default:
</span><span> $menu_pos = $wp_post_types[$p_type]->menu_position ? $wp_post_types[$p_type]->menu_position : 25;
</span><ins>+ $p_type_supports = array('title','editor','author','thumbnail','excerpt','comments');
</ins><span>
</span><span> }
</span><span>
</span><span>@@ -44,7 +47,7 @@
</span><span> 'capability_type' => $wp_post_types[$p_type]->capability_type,
</span><span> 'hierarchical' => $wp_post_types[$p_type]->hierarchical == 1,
</span><span> 'menu_position' => $menu_pos,
</span><del>- 'supports' => array('title','editor','author','thumbnail','excerpt','comments')
</del><ins>+ 'supports' => $p_type_supports
</ins><span> );
</span><span>
</span><span> //TODO: Post types names can only have 20 chars. Ho to deal with it?
</span><span>@@ -163,9 +166,7 @@
</span><span> if ($_GET['action'] != 'edit') {
</span><span> $translation_of = $_GET['translation_of'];
</span><span> } else {
</span><del>- $translation_of = get_post_meta($post->ID, '_translation_of');
- if (is_array($translation_of))
- $translation_of = $translation_of[0];
</del><ins>+ $translation_of = get_post_meta($post->ID, '_translation_of', true);
</ins><span> }
</span><span>
</span><span>
</span><span>@@ -241,9 +242,9 @@
</span><span> mlf_add_post_meta($new, '_translation_of', $original);
</span><span>
</span><span> #var_dump($original, $new); die;
</span><del>-
</del><ins>+
</ins><span> $also_translation_of = get_post_meta($original, '_translation_of');
</span><del>-
</del><ins>+
</ins><span> if (is_array($also_translation_of)) {
</span><span> foreach ($also_translation_of as $a) {
</span><span> if ($a != $new) {
</span><span>@@ -267,11 +268,8 @@
</span><span> if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
</span><span> return $post_id;
</span><span>
</span><del>- if ( 'post' == $_POST['post_type'] ) {
- if ( !current_user_can( 'edit_post', $post_id ) )
- return $post_id;
- }
</del><span>
</span><ins>+
</ins><span> #var_dump($_POST['_translation_of']); die;
</span><span>
</span><span> mlf_add_translation_relationship($_POST['_translation_of'], $post_id);
</span></span></pre>
</div>
</div>
</div>
</div><br>