<?php
class My_Walker_Page extends Walker {
var $tree_type = 'page';
var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');
function start_lvl(&$output, $depth) {
$indent = str_repeat("\t", $depth);
switch ($depth) {
case 0:
$output .= $indent."<ul id=\"drop_nav\">\n";
break;
case 1:
$output .= "<div class=\"subnav\">\n";
$output .= "<div class=\"subnavTop\">\n";
$output .= $indent."<ul class='subnavContent'>\n";
$output .= "<li>\n<dl>\n";
break;
default:
break;
}
}
function end_lvl(&$output, $depth) {
$indent = str_repeat("\t", $depth);
switch ($depth) {
case 0:
$output .= "\n".$indent."</ul>\n";
break;
case 1:
$output .= "\n</dl>\n</li>\n";
$output .= "</div>\n";
$output .= "</div>\n";
$output .= "</div>\n";
break;
default:
break;
}
}
function start_el(&$output, $page, $depth, $args, $current_page) {
if ( $depth )
$indent = str_repeat("\t", $depth);
else
$indent = '';
extract($args, EXTR_SKIP);
$css_class = array('page_item', 'page-item-'.$page->ID);
if ( !empty($current_page) ) {
$_current_page = get_page( $current_page );
_get_post_ancestors($_current_page);
if ( isset($_current_page->ancestors) && in_array($page->ID, (array) $_current_page->ancestors) )
$css_class[] = 'current_page_ancestor';
if ( $page->ID == $current_page )
$css_class[] = 'current_page_item';
elseif ( $_current_page && $page->ID == $_current_page->post_parent )
$css_class[] = 'current_page_parent';
} elseif ( $page->ID == get_option('page_for_posts') ) {
$css_class[] = 'current_page_parent';
}
$css_class = implode(' ', apply_filters('page_css_class', $css_class, $page));
$page_link1 = '<a href="" img="' . get_image("imagem_de_fundo",1,1,0,$page->ID) . '" img01="' . get_image("imagem_01",1,1,0,$page->ID) . '" img02="' . get_image("imagem_02",1,1,0,$page->ID) . '" class="thumbnail" onClick="showHide1(' . "'" . get_the_title($page->ID) . "'" . ')" title="' . esc_attr( wp_strip_all_tags( apply_filters( 'the_title', $page->post_title, $page->ID ) ) ) . "; " . addContent('texto_01', get("texto_01",1,1,1,$page->ID) ) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';
$page_link2 = '<a href="" img="' . get_image("imagem_de_fundo",1,1,0,$page->ID) . '" img01="' . get_image("imagem_01",1,1,0,$page->ID) . '" img02="' . get_image("imagem_02",1,1,0,$page->ID) . '" class="thumbnail" onClick="showHide2(' . "'" . get_the_title($page->ID) . "'" . ')" title="' . esc_attr( wp_strip_all_tags( apply_filters( 'the_title', $page->post_title, $page->ID ) ) ) . "; " . addContent('texto_01', get("texto_01",1,1,1,$page->ID) ) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';
$page_link3 = '<a href="" img="' . get_image("imagem_de_fundo",1,1,0,$page->ID) . '" img01="' . get_image("imagem_01",1,1,0,$page->ID) . '" img02="' . get_image("imagem_02",1,1,0,$page->ID) . '" class="thumbnail" onClick="showHide3(' . "'" . get_the_title($page->ID) . "'" . ')" title="' . esc_attr( wp_strip_all_tags( apply_filters( 'the_title', $page->post_title, $page->ID ) ) ) . "; " . addContent('texto_01', get("texto_01",1,1,1,$page->ID) ) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';
switch ($depth) {
case 0:
$output .= $indent . '<li class="' . $css_class . '">'.$page_link1. '<div id="' . get_the_title($page->ID) . '" style="display:none;">';
$output .= $indent . '<div class="textoexp">' . get('texto_exp',1,1,1,$page->ID) . '';
if ( get('imprensapdf',1,1,1,$page->ID,TRUE) )
$output .= '<div class="imprensadownloads">' . '<a href="' . get('imprensapdf',1,1,1,$page->ID) . '" target="_blank">Descarregar Artigo</a></div>';
else
$output .= "";
if ( get('imprensadoc',1,1,1,$page->ID,TRUE) )
$output .= '<div class="imprensadownloads">' . '<a href="' . get('imprensadoc',1,1,1,$page->ID) . '" target="_blank">Descarregar Texto</a></div>';
else
$output .= "";
$output .= "</div>";
break;
case 1:
$output .= $indent . '<dt class="' . $css_class . '">' .$page_link2. '<div id="' . get_the_title($page->ID) . '" style="display:none;">';
$output .= $indent . '<div class="textoexp">' . get('texto_exp',1,1,1,$page->ID) . '';
if ( get('imprensapdf',1,1,1,$page->ID,TRUE) )
$output .= '<div class="imprensadownloads">' . '<a href="' . get('imprensapdf',1,1,1,$page->ID) . '" target="_blank">Descarregar Artigo</a></div>';
else
$output .= "";
if ( get('imprensadoc',1,1,1,$page->ID,TRUE) )
$output .= '<div class="imprensadownloads">' . '<a href="' . get('imprensadoc',1,1,1,$page->ID) . '" target="_blank">Descarregar Texto</a></div>';
else
$output .= "";
$output .= "</div>";
break;
default:
$output .= $indent . '<dd class="' . $css_class . '">'.$page_link3. '<div id="' . get_the_title($page->ID) . '" style="display:none;">';
$output .= $indent . '<div class="textoexp">' . get('texto_exp',1,1,1,$page->ID) . '';
if ( get('imprensapdf',1,1,1,$page->ID,TRUE) )
$output .= '<div class="imprensadownloads">' . '<a href="' . get('imprensapdf',1,1,1,$page->ID) . '" target="_blank">Descarregar Artigo</a></div>';
else
$output .= "";
if ( get('imprensadoc',1,1,1,$page->ID,TRUE) )
$output .= '<div class="imprensadownloads">' . '<a href="' . get('imprensadoc',1,1,1,$page->ID) . '" target="_blank">Descarregar Texto</a></div>';
else
$output .= "";
$output .= "</div>";
break;
}
if ( !empty($show_date) ) {
if ( 'modified' == $show_date )
$time = $page->post_modified;
else
$time = $page->post_date;
$output .= " " . mysql2date($date_format, $time);
}
}
function end_el(&$output, $page, $depth) {
switch ($depth) {
case 0:
$output .= "</li>\n";
break;
case 1:
$output .= "</dt>\n";
break;
default:
$output .= "</dd>\n";
break;
}
}
}
?>
<?php
function mytheme_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID(); ?>">
<?php if ($comment->comment_approved == '0') : ?>
<?php _e('(O seu comentario aguarda moderacao.)') ?>
<br />
<?php endif; ?>
<div class="comment-author vcard">
<?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?></br>
<b><?php printf(__('Escrito por %s'), get_comment_author_link()) ?></b>
</div>
<div class="comment-meta commentmetadata"><?php edit_comment_link(__('(Edit)'),' ','') ?></div>
<?php comment_text() ?>
<div class="reply">
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
</div>
<?php
}
?>