This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Transforma o bloco dos parceiros em widget para faciltiar gerenciamento.

  • Loading branch information...
jpjoao committed Mar 23, 2015
1 parent 3c158bd commit 313197cf732fa8ceefcf76b73699797a9556b300
Showing with 66 additions and 40 deletions.
  1. +0 −38 footer.php
  2. +38 −0 widget-parceiros.php
  3. +28 −2 widgets.php
View
@@ -1,44 +1,6 @@
</section><!-- #main .wrapper -->
<footer role="contentinfo">
<?php dynamic_sidebar('footer-links'); ?>
<section class="footer_links">
<a href="http://www.soyuz.com.br/" target="_blank">
<img alt="Soyuz"
src="<?php bloginfo( 'template_url' ); ?>/img/soyuz.png">
</a>
<a href="http://www.php.net/" target="_blank">
<img alt="Php"
src="<?php bloginfo( 'template_url' ); ?>/img/php.png">
</a>
<a href="http://www.windowsazure.com/pt-br/" target="_blank">
<img alt="Windows Azure"
src="<?php bloginfo( 'template_url' ); ?>/img/azure.png">
</a>
<a href="http://imasters.com.br/" target="_blank">
<img alt="iMasters"
src="<?php bloginfo( 'template_url' ); ?>/img/imasters.png">
</a>
<a href="https://contaazul.com/" target="_blank">
<img alt="Conta Azul"
src="<?php bloginfo( 'template_url' ); ?>/img/contaazul.png">
</a>
<a href="http://www.jetbrains.com/phpstorm/" target="_blank">
<img alt="Jet Brains"
src="<?php bloginfo( 'template_url' ); ?>/img/logo_phpstorm.png">
</a>
</section>
<nav class="visible-phone">
<ul id="menu-pages" class="container menu">
<?php wp_list_pages('title_li='); ?>
<li><a href="<?php bloginfo('url'); ?>?feed=rss2">Subscribe</a></li>
</ul>
</nav>
<section id="creative-commons" class="container">
<a class="img-cc" rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.pt">
<img alt="Licença Creative Commons" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png" />
</a>
<p class="desc-cc span5">O trabalho Portal de <a href="http://phpsp.org.br" property="cc:attributionName" rel="cc:attributionURL">PHP-SP</a> foi licenciado com uma Licença <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.pt">Creative Commons - Atribuição-NãoComercial-SemDerivados 3.0 Não Adaptada</a>.</p>
</section>
</footer>
<?php wp_footer(); ?>
</body>
View
@@ -0,0 +1,38 @@
<section class="footer_links">
<a href="http://www.soyuz.com.br/" target="_blank">
<img alt="Soyuz"
src="<?php bloginfo( 'template_url' ); ?>/img/soyuz.png">
</a>
<a href="http://www.php.net/" target="_blank">
<img alt="Php"
src="<?php bloginfo( 'template_url' ); ?>/img/php.png">
</a>
<a href="http://www.windowsazure.com/pt-br/" target="_blank">
<img alt="Windows Azure"
src="<?php bloginfo( 'template_url' ); ?>/img/azure.png">
</a>
<a href="http://imasters.com.br/" target="_blank">
<img alt="iMasters"
src="<?php bloginfo( 'template_url' ); ?>/img/imasters.png">
</a>
<a href="https://contaazul.com/" target="_blank">
<img alt="Conta Azul"
src="<?php bloginfo( 'template_url' ); ?>/img/contaazul.png">
</a>
<a href="http://www.jetbrains.com/phpstorm/" target="_blank">
<img alt="Jet Brains"
src="<?php bloginfo( 'template_url' ); ?>/img/logo_phpstorm.png">
</a>
</section>
<nav class="visible-phone">
<ul id="menu-pages" class="container menu">
<?php wp_list_pages('title_li='); ?>
<li><a href="<?php bloginfo('url'); ?>?feed=rss2">Subscribe</a></li>
</ul>
</nav>
<section id="creative-commons" class="container">
<a class="img-cc" rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.pt">
<img alt="Licença Creative Commons" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png" />
</a>
<p class="desc-cc span5">O trabalho Portal de <a href="http://phpsp.org.br" property="cc:attributionName" rel="cc:attributionURL">PHP-SP</a> foi licenciado com uma Licença <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.pt">Creative Commons - Atribuição-NãoComercial-SemDerivados 3.0 Não Adaptada</a>.</p>
</section>
View
@@ -274,11 +274,31 @@ public function form($instance) {
}
}
class PHPSP_Parceiros_Widget extends WP_Widget {
public function PHPSP_Parceiros_Widget() {
parent::WP_Widget('phpsp-parceiros', 'PHPSP - Parceiros', 'Imagem dos parceiros do PHPSP');
}
public function widget ($args, $instance) {
get_template_part('widget', 'parceiros');
}
public function update($new_instance, $old_instance) {
return $new_instance;
}
public function form($instance) {
echo '';
}
}
function PHPSP_register_widgets() {
register_widget( 'PHPSP_Artigos_Widget' );
register_widget( 'PHPSP_Avisos_Widget' );
register_widget( 'PHPSP_Topo_Widget' );
register_widget( 'PHPSP_Facebook_Widget' );
register_widget( 'PHPSP_Parceiros_Widget' );
}
add_action( 'widgets_init', 'PHPSP_register_widgets' );
@@ -372,6 +392,7 @@ function PHPSP_register_widgets() {
}
//Configura o Rodape
unset($active_widgets['footer-links']);
if (empty($active_widgets['footer-links'])) {
$hasChange = true;
@@ -380,13 +401,18 @@ function PHPSP_register_widgets() {
//Facebook
$active_widgets['footer-links'][0] = 'phpsp-facebook-'.$counter;
$footer_widget_content[$counter] = array(
$footer_facebook_widget_content[$counter] = array(
'title' => 'Curta o PHPSP',
);
$active_widgets['footer-links'][1] = 'phpsp-parceiros-'.$counter;
$footer_partners_widget_content[$counter] = array();
$counter++;
update_option('widget_phpsp-facebook', $footer_widget_content);
update_option('widget_phpsp-facebook', $footer_facebook_widget_content);
update_option('widget_phpsp-parceiros', $footer_partners_widget_content);
}
if ($hasChange) {

0 comments on commit 313197c

Please sign in to comment.