-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53b12a2
commit c76d734
Showing
13 changed files
with
77 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
/* | ||
Plugin Name: Amministrazione Trasparente | ||
Plugin URI: https://wordpress.org/plugins/amministrazione-trasparente/ | ||
Description: Soluzione completa per la pubblicazione online dei documenti ai sensi del D.lgs. n. 33 del 14/03/2013, riguardante il riordino della disciplina degli obblighi di pubblicità, trasparenza e diffusione di informazioni da parte delle pubbliche amministrazioni, in attuazione dell’art. 1, comma 35, della legge n. 190/2012. | ||
Version: 8.0.2 | ||
Description: Soluzione completa per la pubblicazione online dei documenti ai sensi del D.lgs. n. 33 del 14/03/2013 | ||
Version: 8.0.5 | ||
Author: Marco Milesi | ||
Author Email: [email protected] | ||
Author URI: https://www.marcomilesi.com | ||
|
@@ -250,22 +250,23 @@ function at_force_template( $template ) { | |
if( is_tax( 'tipologie' ) || is_tax( 'annirif' ) || is_tax( 'ditte' ) ) { | ||
$theme_name = strtolower(wp_get_theme()); | ||
if (get_template() == 'pasw2013' || $theme_name == 'pasw2013' || at_option('pasw_2013') == '1') { //Se è attivata la modalità "Forza template PASW" | ||
$template = WP_PLUGIN_DIR .'/'. plugin_basename( dirname(__FILE__) ) .'/pasw2013/paswarchive-tipologie.php'; | ||
$template = WP_PLUGIN_DIR .'/'. plugin_basename( dirname(__FILE__) ) .'/inc/pasw2013/paswarchive-tipologie.php'; | ||
} | ||
|
||
} else if ( is_singular( 'amm-trasparente' ) ) { | ||
$theme_name = strtolower(wp_get_theme()); | ||
if (get_template() == 'pasw2013' || $theme_name == 'pasw2013' || at_option('pasw_2013') == '1') { //Se è attivata la modalità "Forza template PASW" | ||
$template = WP_PLUGIN_DIR .'/'. plugin_basename( dirname(__FILE__) ) .'/pasw2013/paswsingle-tipologie.php'; | ||
$template = WP_PLUGIN_DIR .'/'. plugin_basename( dirname(__FILE__) ) .'/inc/pasw2013/paswsingle-tipologie.php'; | ||
} | ||
} | ||
return $template; | ||
} | ||
add_filter( 'template_include', 'at_force_template' ); | ||
|
||
add_action( 'admin_enqueue_scripts', function() { // searchTaxonomyGT by Gabriel Tavares // http://www.gtplugins.com | ||
wp_register_script('searchTaxonomyGT_at_js', plugins_url('/includes/searchTaxonomyGT.js', __FILE__)); | ||
wp_enqueue_script('searchTaxonomyGT_at_js'); | ||
// searchTaxonomyGT by Gabriel Tavares http://www.gtplugins.com | ||
add_action( 'admin_enqueue_scripts', function() { | ||
wp_register_script('at_searchTaxonomyGT', plugins_url('/inc/js/searchTaxonomyGT.js', __FILE__)); | ||
wp_enqueue_script('at_searchTaxonomyGT'); | ||
} ); | ||
|
||
add_action( 'restrict_manage_posts', function() { | ||
|
@@ -310,7 +311,9 @@ function at_force_template( $template ) { | |
require_once(plugin_dir_path(__FILE__) . 'sezioni.php'); | ||
require_once(plugin_dir_path(__FILE__) . 'widget/widget.php'); | ||
require_once(plugin_dir_path(__FILE__) . 'redirector.php'); | ||
require_once(plugin_dir_path(__FILE__) . 'admin-messages.php'); | ||
|
||
require_once(plugin_dir_path(__FILE__) . 'backend.php'); | ||
$AmministrazioneTrasparente_Backend = new AmministrazioneTrasparente_Backend(); | ||
|
||
add_action( 'admin_menu', function() { | ||
add_submenu_page( 'edit.php?post_type=amm-trasparente', 'Impostazioni', 'Impostazioni', 'publish_posts', 'wpgov_at', function() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
class AmministrazioneTrasparente_Backend { | ||
function __construct() { | ||
add_action( 'admin_notices', [ $this, 'adminMessages' ] ); | ||
add_action( 'manage_amm-trasparente_posts_columns', [ $this, 'modified_column_register' ] ); | ||
add_action( 'manage_amm-trasparente_posts_custom_column', [ $this, 'modified_column_display' ], 10, 2 ); | ||
add_action( 'manage_edit-amm-trasparente_sortable_columns', [ $this, 'modified_column_register_sortable' ] ); | ||
} | ||
function adminMessages() { | ||
global $current_screen ; | ||
|
||
$get_at_option_id = at_option('page_id'); | ||
if ($get_at_option_id == '0') { /* Se non è stato compilato l'url per "Torna al Sommario", informiamo brutalmente l'admin fino a quando non provvede :-) */ | ||
echo ' | ||
<div class="notice notice-error"> | ||
<p><b>AMMINISTRAZIONE TRASPARENTE</b></p> | ||
<p>Per iniziare crea una nuova pagina per "Amministrazione Trasparente" utilizzando gli <a href="//wpgov.it/docs/amministrazione-trasparente/" target="_blank">shortcode</a> del plugin.<br /> | ||
Ricorda di inserire l\'ID della pagina in <b>Trasparenza -> Impostazioni</b></p> | ||
</div>'; | ||
} | ||
|
||
if ( is_active_widget( false, false, 'atwidget', true ) && ( get_option( 'at_option_widget' ) || get_option( 'at_logic_widget') ) ) { | ||
get_option( 'at_option_widget' ) ? $a = 'SI' : $a = 'NO'; | ||
get_option( 'at_logic_widget' ) ? $b = 'SI' : $b = 'NO'; | ||
echo ' | ||
<div class="notice notice-error"> | ||
<p><b>AMMINISTRAZIONE TRASPARENTE</b></p> | ||
<p>A seguito di alcuni aggiornamenti al <b>widget</b> abbiamo rilevato che in questo sito è necessario salvare nuovamente le impostazioni in "Aspetto -> Widget -> Amministrazione Trasparente".</p> | ||
<p>La configurazione del widget è resettata ai valori di default.</p> | ||
<p>Vecchia configurazione: <b>Voci espandibili = '.$a.', Visualizzazione condizionale = '.$b.'</b> | ||
</div>'; | ||
} | ||
} | ||
|
||
function modified_column_register( $columns ) { | ||
$columns['Modified'] = 'Ultima modifica'; | ||
return $columns; | ||
} | ||
|
||
function modified_column_display( $column_name, $post_id ) { | ||
switch ( $column_name ) { | ||
case 'Modified': | ||
echo get_the_modified_author().'<br>'; | ||
echo get_the_modified_date( 'd/m/Y', $post_id ).' alle '.get_the_modified_time( 'G:i' ); | ||
break; // end all case breaks | ||
} | ||
} | ||
|
||
function modified_column_register_sortable( $columns ) { | ||
$columns['Modified'] = 'modified'; | ||
return $columns; | ||
} | ||
} | ||
?> |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters