| @@ -23,18 +23,19 @@ | ||
| 23 | 23 | // non-admin enqueues, actions, and filters |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | function avcp_reg_settings() { |
| 27 | - register_setting( 'avcp_options', 'avcp_version_number'); update_option( 'avcp_version_number', '2.0' ); | |
| 27 | + register_setting( 'avcp_options', 'avcp_version_number'); update_option( 'avcp_version_number', '3.0' ); | |
| 28 | 28 | register_setting( 'avcp_options', 'avcp_denominazione_ente'); |
| 29 | 29 | register_setting( 'avcp_options', 'avcp_codicefiscale_ente'); |
| 30 | 30 | register_setting( 'avcp_options', 'avcp_autopublish'); |
| 31 | 31 | register_setting( 'avcp_options', 'avcp_dis_archivioditte'); |
| 32 | 32 | register_setting( 'avcp_options', 'avcp_dis_archivioanni'); |
| 33 | - register_setting( 'avcp_options', 'avcp_dis_styledbackend'); | |
| 34 | 33 | register_setting( 'avcp_options', 'avcp_tab_jqueryui'); |
| 35 | 34 | register_setting( 'avcp_options', 'avcp_showxml'); |
| 36 | 35 | register_setting( 'avcp_options', 'avcp_showlove'); |
| 36 | + register_setting( 'avcp_options', 'avcp_invalid'); | |
| 37 | + register_setting( 'avcp_options', 'avcp_abilita_ruoli'); | |
| 37 | 38 | } |
| 38 | 39 | |
| 39 | 40 | function avcp_setting_menu() |
| 40 | 41 | { |
| @@ -54,9 +55,9 @@ | ||
| 54 | 55 | foreach ( $terms as $term ) { |
| 55 | 56 | creafilexml ($term->name); |
| 56 | 57 | $verificafilecreati = $term->name . ' - ' . $verificafilecreati; |
| 57 | 58 | echo '<div class="updated"><p>'; |
| 58 | - printf(__('AVCP | Il seguente file .xml è stato creato correttamente: <b>' . $term->name . '</b>')); | |
| 59 | + printf(__('AVCP | Il seguente file .xml è generato: <b>' . $term->name . '</b>')); | |
| 59 | 60 | echo "</p></div>"; |
| 60 | 61 | } |
| 61 | 62 | } else { |
| 62 | 63 | echo '<div class="error"><p>'; |
| @@ -104,8 +105,13 @@ | ||
| 104 | 105 | update_option('avcp_showlove', '1'); |
| 105 | 106 | } else { |
| 106 | 107 | update_option('avcp_showlove', '0'); |
| 107 | 108 | } |
| 109 | + if (isset($_POST['avcp_abilita_ruoli_n'])){ | |
| 110 | + update_option('avcp_abilita_ruoli', '1'); | |
| 111 | + } else { | |
| 112 | + update_option('avcp_abilita_ruoli', '0'); | |
| 113 | + } | |
| 108 | 114 | } |
| 109 | 115 | |
| 110 | 116 | echo '<div class="wrap">'; |
| 111 | 117 | screen_icon(); |
| @@ -119,9 +125,9 @@ | ||
| 119 | 125 | <img alt="" border="0" src="https://www.paypalobjects.com/it_IT/i/scr/pixel.gif" width="1" height="1"> |
| 120 | 126 | </form> |
| 121 | 127 | </div> |
| 122 | 128 | |
| 123 | -<h2>AVCP XML v' . get_option('avcp_version_number') . ' <a href="http://wordpress.org/plugins/avcp/installation/" target="_blank" class="add-new-h2">Installazione</a><a href="http://marcomilesi.ml/supporto" target="_blank" class="add-new-h2">Forum di Supporto</a><a href="http://wordpress.org/plugins/avcp/changelog/" target="_blank" class="add-new-h2">CHANGELOG</a></h2>' | |
| 129 | +<h2>AVCP XML v' . get_option('avcp_version_number') . ' <a href="http://wordpress.org/plugins/avcp/installation/" target="_blank" class="add-new-h2">Installazione</a><a href="http://supporto.marcomilesi.ml/" target="_blank" class="add-new-h2">Forum di Supporto</a><a href="http://wordpress.org/plugins/avcp/changelog/" target="_blank" class="add-new-h2">CHANGELOG</a></h2>' | |
| 124 | 130 | ); |
| 125 | 131 | |
| 126 | 132 | // SYSTEM CHECK |
| 127 | 133 | echo '<form method="post" name="options" target="_self">'; |
| @@ -127,10 +133,11 @@ | ||
| 127 | 133 | echo '<form method="post" name="options" target="_self">'; |
| 128 | 134 | settings_fields('avcp_options'); |
| 129 | 135 | echo '<div id="welcome-panel" style="margin:10px;width:50%;float:left;" class="welcome-panel"> |
| 130 | 136 | <h3><span>Generazione file .xml</span></h3> |
| 131 | - I file .xml generati sono pubblicamente accessibili da: <b><a class="add-new-h2" href="' . get_site_url() . '/avcp' . '" target="_blank">' . get_site_url() . '/avcp' . '</a></b><br/> | |
| 132 | - <center><p class="submit"><input type="submit" class="button-primary" name="XMLgenBUTTON" value="Genera XML" /><br/>Clicca qui per generare manualmente i file .xml (verranno creati i file divisi per anno prendendo come riferimento il campo "Anno di Riferimento" inserito nelle varie voci).<br/>Per <b>cancellare</b> i file, accedere via ftp!</p><p style="color:red;">Attenzione! Questa funzione non sostituisce la comunicazione obbligatoria dell\'url del file .xml ad AVCP, secondo le disposizioni normative vigenti.</p></center>'; | |
| 137 | + I file .xml generati sono pubblicamente accessibili all\'indirizzo <b><a href="' . get_site_url() . '/avcp' . '" target="_blank">' . get_site_url() . '/avcp' . '</a>*</b><br/>'; | |
| 138 | + | |
| 139 | + echo'<p style="text-align:center;" class="submit"><input type="submit" class="button-primary" name="XMLgenBUTTON" value="Crea Dataset" /><br/><br/><br/><font style="color:red;">*Attenzione! Questa funzione non sostituisce la comunicazione obbligatoria dell\'url del file .xml ad AVCP, secondo le disposizioni normative vigenti.</font></p>'; | |
| 133 | 140 | |
| 134 | 141 | echo '</div>'; |
| 135 | 142 | echo ' |
| 136 | 143 | <div id="alert" style="margin:10px;width:40%;float:left;" class="welcome-panel"> |
| @@ -165,45 +172,51 @@ | ||
| 165 | 172 | |
| 166 | 173 | $urlcheck = get_site_url() . '/avcp/index.php'; |
| 167 | 174 | |
| 168 | 175 | $agent = "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; pt-pt) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27"; |
| 169 | - | |
| 170 | - // initializes curl session | |
| 171 | - $ch=curl_init(); | |
| 172 | - | |
| 173 | - // sets the URL to fetch | |
| 174 | - curl_setopt ($ch, CURLOPT_URL,$urlcheck ); | |
| 175 | - | |
| 176 | - // sets the content of the User-Agent header | |
| 177 | - curl_setopt($ch, CURLOPT_USERAGENT, $agent); | |
| 178 | - | |
| 179 | - // return the transfer as a string | |
| 180 | - curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); | |
| 181 | - | |
| 182 | - // disable output verbose information | |
| 183 | - curl_setopt ($ch,CURLOPT_VERBOSE,false); | |
| 184 | - | |
| 185 | - // max number of seconds to allow cURL function to execute | |
| 186 | - curl_setopt($ch, CURLOPT_TIMEOUT, 5); | |
| 187 | - | |
| 188 | - curl_exec($ch); | |
| 189 | - | |
| 190 | - // get HTTP response code | |
| 191 | - $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); | |
| 192 | - | |
| 193 | - curl_close($ch); | |
| 194 | - | |
| 195 | - if($httpcode==200) { | |
| 196 | - echo 'Test Accesso pubblico /avcp<font style="color:green;font-weight:bold;"> ==> OK [200]</font>'; | |
| 197 | - } else if($httpcode==500) { | |
| 198 | - echo 'Test Accesso pubblico /avcp<font style="color:red;font-weight:bold;"> ==> ERRORE 500 ISE</font>'; | |
| 199 | - $headers = get_headers($urlcheck); | |
| 200 | - echo ' - ' . $headers[0]; | |
| 201 | - $system_ok = false; | |
| 176 | + | |
| 177 | + if(is_callable('curl_init')){ | |
| 178 | + | |
| 179 | + // initializes curl session | |
| 180 | + $ch=curl_init(); | |
| 181 | + | |
| 182 | + // sets the URL to fetch | |
| 183 | + curl_setopt ($ch, CURLOPT_URL,$urlcheck ); | |
| 184 | + | |
| 185 | + // sets the content of the User-Agent header | |
| 186 | + curl_setopt($ch, CURLOPT_USERAGENT, $agent); | |
| 187 | + | |
| 188 | + // return the transfer as a string | |
| 189 | + curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); | |
| 190 | + | |
| 191 | + // disable output verbose information | |
| 192 | + curl_setopt ($ch,CURLOPT_VERBOSE,false); | |
| 193 | + | |
| 194 | + // max number of seconds to allow cURL function to execute | |
| 195 | + curl_setopt($ch, CURLOPT_TIMEOUT, 5); | |
| 196 | + | |
| 197 | + curl_exec($ch); | |
| 198 | + | |
| 199 | + // get HTTP response code | |
| 200 | + $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); | |
| 201 | + | |
| 202 | + curl_close($ch); | |
| 203 | + | |
| 204 | + if($httpcode==200) { | |
| 205 | + echo 'Test Accesso pubblico /avcp<font style="color:green;font-weight:bold;"> ==> OK [200]</font>'; | |
| 206 | + } else if($httpcode==500) { | |
| 207 | + echo 'Test Accesso pubblico /avcp<font style="color:red;font-weight:bold;"> ==> ERRORE 500 ISE</font>'; | |
| 208 | + $headers = get_headers($urlcheck); | |
| 209 | + echo ' - ' . $headers[0]; | |
| 210 | + $system_ok = false; | |
| 211 | + } else { | |
| 212 | + echo 'Test Accesso pubblico /avcp<font style="color:red;font-weight:bold;"> ==> ERRORE ' . $httpcode . '</font>'; | |
| 213 | + $headers = get_headers($urlcheck); | |
| 214 | + echo ' - ' . $headers[0]; | |
| 215 | + $system_ok = false; | |
| 216 | + } | |
| 202 | 217 | } else { |
| 203 | - echo 'Test Accesso pubblico /avcp<font style="color:red;font-weight:bold;"> ==> ERRORE ' . $httpcode . '</font>'; | |
| 204 | - $headers = get_headers($urlcheck); | |
| 205 | - echo ' - ' . $headers[0]; | |
| 218 | + echo 'Test Accesso pubblico /avcp<font style="color:red;font-weight:bold;"> ==> CURL_INIT MANCANTE</font>'; | |
| 206 | 219 | $system_ok = false; |
| 207 | 220 | } |
| 208 | 221 | |
| 209 | 222 | |
| @@ -208,9 +221,9 @@ | ||
| 208 | 221 | |
| 209 | 222 | |
| 210 | 223 | echo '<h4>Esito:</h4>'; |
| 211 | 224 | if ($system_ok) { |
| 212 | - echo 'Nessun problema rilevato con il server. Molto bene!'; | |
| 225 | + echo 'Nessun problema tecnico rilevato con il server. Molto bene!'; | |
| 213 | 226 | } else { |
| 214 | 227 | echo ' |
| 215 | 228 | <style> |
| 216 | 229 | #alert { |
| @@ -220,9 +233,9 @@ | ||
| 220 | 233 | echo 'Sono stati trovati alcuni problemi <b>critici</b>. Affinchè AVCP funzioni correttamente è necessario risolvere al più presto questi problemi. Consultare la documentazione del plugin per conoscere le cause più probabili di questo problema!'; |
| 221 | 234 | } |
| 222 | 235 | echo '</div> |
| 223 | 236 | <div class="clear"></div>'; |
| 224 | - | |
| 237 | + | |
| 225 | 238 | //Qui inizia la sezione delle impostazioni |
| 226 | 239 | |
| 227 | 240 | echo ' |
| 228 | 241 | <div class="postbox-container" style="width: 100%"> |
| @@ -260,9 +273,9 @@ | ||
| 260 | 273 | </div></div>'; |
| 261 | 274 | |
| 262 | 275 | echo ' |
| 263 | 276 | <div class="postbox" id="second"> |
| 264 | - <h3 class="hndle"><span>Impostazioni Tabella</span></h3> | |
| 277 | + <h3 class="hndle"><span>Impostazioni Varie</span></h3> | |
| 265 | 278 | <div class="inside"> |
| 266 | 279 | |
| 267 | 280 | <table class="form-table"><tbody>'; |
| 268 | 281 | |
| @@ -276,8 +289,18 @@ | ||
| 276 | 289 | echo '><span class="description">Spunta questa casella se vuoi abilitare il tema jQueryUI Themeroller per la tabella</span></td>'; |
| 277 | 290 | echo '</tr>'; |
| 278 | 291 | |
| 279 | 292 | echo '<tr>'; |
| 293 | + echo '<th><label>Ruoli & Permessi</label></th>'; | |
| 294 | + echo '<td><input type="checkbox" name="avcp_abilita_ruoli_n" '; | |
| 295 | + $get_avcp_abilita_ruoli = get_option('avcp_abilita_ruoli'); | |
| 296 | + if ($get_avcp_abilita_ruoli == '1') { | |
| 297 | + echo 'checked="checked" '; | |
| 298 | + } | |
| 299 | + echo '><span class="description">Le voci di AVCP ereditano i permessi di pubblicazione/modifica/eliminazione degli articoli. Se vuoi avere un maggior controllo abilita questa opzione e segui <a href="http://supporto.marcomilesi.ml/?p=571" target="_blank" title="Istruzioni per la configurazione di Ruoli & Permessi">questo tutorial</span></td>'; | |
| 300 | + echo '</tr>'; | |
| 301 | + | |
| 302 | + echo '<tr>'; | |
| 280 | 303 | echo '<th><label>Mostra Link XML</label></th>'; |
| 281 | 304 | echo '<td><input type="checkbox" name="avcp_showxml_n" '; |
| 282 | 305 | $get_avcp_showxml = get_option('avcp_showxml'); |
| 283 | 306 | if ($get_avcp_showxml == '1') { |
| @@ -328,28 +351,9 @@ | ||
| 328 | 351 | |
| 329 | 352 | echo '</tbody></table> |
| 330 | 353 | </div></div>'; |
| 331 | 354 | |
| 332 | - echo ' | |
| 333 | - <div class="postbox" id="second"> | |
| 334 | - <h3 class="hndle"><span>Altre Impostazioni</span></h3> | |
| 335 | - <div class="inside"> | |
| 336 | - | |
| 337 | - <table class="form-table"><tbody>'; | |
| 338 | - | |
| 339 | - echo '<tr>'; | |
| 340 | - echo '<th><label>CSS Backend</label></th>'; | |
| 341 | - echo '<td><input type="checkbox" name="avcp_dis_styledbackend_n" '; | |
| 342 | - $get_avcp_dis_styledbackend = get_option('avcp_dis_styledbackend'); | |
| 343 | - if ($get_avcp_dis_styledbackend == '0') { | |
| 344 | - echo 'checked="checked" '; | |
| 345 | - } | |
| 346 | - echo '><span class="description">Abilita il caricamento di css aggiuntivo per le pagine di amministrazione AVCP</span></td>'; | |
| 347 | - echo '</tr>'; | |
| 348 | - | |
| 349 | - echo '</tbody></table> | |
| 350 | - </div></div> | |
| 351 | - </div></div> | |
| 355 | + echo '</div></div> | |
| 352 | 356 | <p class="submit"><input type="submit" class="button-primary" name="Submit" value="AGGIORNA IMPOSTAZIONI" /></p>'; |
| 353 | 357 | |
| 354 | 358 | echo '</form>'; |
| 355 | 359 | |
| @@ -362,9 +366,9 @@ | ||
| 362 | 366 | <hr/> |
| 363 | 367 | <a href="http://wordpress.org/plugins/amministrazione-aperta/" target="_blank" title="Plugin Wordpress per la gestione di Spese, Contributi, Concessioni, Incarichi..."> |
| 364 | 368 | <img src="' . plugin_dir_url(__FILE__) . 'includes/aa.png"/></a> |
| 365 | 369 | <hr/> |
| 366 | - Sviluppo e ideazione Wordpress a cura di <a href="http://marcomilesi.ml" target="_blank" title="www.marcomilesi.ml">Marco Milesi</a><br/><small>Per la preparazione di questo programma sono state impiegate diverse ore a titolo volontario. Se vuoi, puoi effettuare una piccola donazione utilizzando il link che trovi in alto a destra.<br/>Per qualsiasi informazione e per segnalare un problema è attivo il forum di supporto su <a href="http://marcomilesi.ml/supporto" target="_blank" title="www.marcomilesi.ml/supporto">www.marcomilesi.ml/supporto</a></small></center> | |
| 370 | + Sviluppo e ideazione Wordpress a cura di <a href="http://marcomilesi.ml" target="_blank" title="www.marcomilesi.ml">Marco Milesi</a><br/><small>Per la preparazione di questo programma sono state impiegate diverse ore a titolo volontario. Se vuoi, puoi effettuare una piccola donazione utilizzando il link che trovi in alto a destra.<br/>Per qualsiasi informazione e per segnalare un problema è attivo il forum di supporto su <a href="http://supporto.marcomilesi.ml/" target="_blank" title="supporto.marcomilesi.ml">supporto.marcomilesi.ml</a></small></center> | |
| 367 | 371 | </div>'; |
| 368 | 372 | |
| 369 | 373 | } |
| 370 | 374 | ?> |