Changeset 8311


Ignore:
Timestamp:
12/27/10 02:47:29 (8 years ago)
Author:
plg
Message:

feature 2087 added: use a checkbox in the installation screen for newsletter subscription

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/install.tpl

    r8310 r8311  
    1515{/foreach} 
    1616 
    17 <script type="text/javascript" src="themes/default/js/jquery.min.js"></script> 
     17<!-- BEGIN get_combined_scripts --> 
     18{get_combined_scripts load='header'} 
     19<!-- END get_combined_scripts --> 
     20 
     21{combine_script id='jquery' path='themes/default/js/jquery.min.js'} 
    1822{literal} 
    1923<script type="text/javascript"> 
     
    4953    return false; 
    5054  }); 
     55 
     56  $("#admin_mail").keyup(function() { 
     57    $(".adminEmail").text($(this).val()); 
     58  }); 
    5159}); 
    5260 
     
    147155</style> 
    148156{/literal} 
     157 
     158{combine_script id='jquery.cluetip' load='async' require='jquery' path='themes/default/js/plugins/jquery.cluetip.packed.js'} 
     159 
     160{footer_script require='jquery.cluetip'} 
     161jQuery().ready(function(){ldelim} 
     162        jQuery('.cluetip').cluetip({ldelim} 
     163                width: 300, 
     164                splitTitle: '|', 
     165                positionBy: 'bottomTop' 
     166        }); 
     167}); 
     168{/footer_script} 
     169 
     170 
    149171<title>Piwigo {$RELEASE} - {'Installation'|@translate}</title> 
    150172</head> 
     
    296318    <tr> 
    297319      <td class="fieldname">{'Webmaster mail address'|@translate}</td> 
    298       <td><input type="text" name="admin_mail" value="{$F_ADMIN_EMAIL}"></td> 
     320      <td><input type="text" name="admin_mail" id="admin_mail" value="{$F_ADMIN_EMAIL}"></td> 
    299321      <td class="fielddesc">{'Visitors will be able to contact site administrator with this mail'|@translate}</td> 
     322    </tr> 
     323    <tr> 
     324      <td>{'Options'|@translate}</options> 
     325      <td colspan="2"> 
     326<label> 
     327<input type="checkbox" name="newsletter_subscribe"{if $F_NEWSLETTER_SUBSCRIBE} checked="checked"{/if}> 
     328<span class="cluetip" title="{'Piwigo Announcements Newsletter'|@translate}|{'Keep in touch with Piwigo project, subscribe to Piwigo Announcement Newsletter. You will receive emails when a new release is available (sometimes including a security bug fix, it\'s important to know and upgrade) and when major events happen to the project. Only a few emails a year.'|@translate|htmlspecialchars|nl2br}">{'Subscribe %s to Piwigo Announcements Newsletter'|@translate|@sprintf:$EMAIL}</span> 
     329</label> 
     330<br> 
     331      </td> 
    300332    </tr> 
    301333  </table> 
     
    311343  <input type="button" name="Home" value="{'Visit Gallery'|@translate}" onClick="window.open('index.php');"> 
    312344</p> 
    313  
    314 {if !isset($migration)} 
    315 <div class="infos"> 
    316   <ul> 
    317     <li>{'Keep in touch with Piwigo project, subscribe to Piwigo Announcement Newsletter. You will receive emails when a new release is available (sometimes including a security bug fix, it\'s important to know and upgrade) and when major events happen to the project. Only a few emails a year.'|@translate}</li> 
    318   </ul> 
    319 </div> 
    320  
    321 <p> 
    322   <input type="button" name="subscribe" value="{'Subscribe %s'|@translate|@sprintf:$F_ADMIN_EMAIL}" onClick="window.open('{$SUBSCRIBE_BASE_URL}{$F_ADMIN_EMAIL}');"> 
    323 </p> 
    324 {/if} 
    325345{/if} 
    326346</div> {* content *} 
    327347<div style="text-align: center">{$L_INSTALL_HELP}</div> 
    328348</div> {* the_page *} 
     349 
     350<!-- BEGIN get_combined_scripts --> 
     351{get_combined_scripts load='footer'} 
     352<!-- END get_combined_scripts --> 
     353 
    329354</body> 
    330355</html> 
  • trunk/install.php

    r8310 r8311  
    144144$admin_mail = (!empty($_POST['admin_mail'])) ? $_POST['admin_mail'] : ''; 
    145145 
     146$is_newsletter_subscribe = true; 
     147if (isset($_POST['install'])) 
     148{ 
     149  $is_newsletter_subscribe = isset($_POST['newsletter_subscribe']); 
     150} 
     151 
    146152$infos = array(); 
    147153$errors = array(); 
     
    382388      $datas 
    383389      ); 
     390 
     391    if ($is_newsletter_subscribe) 
     392    { 
     393      fetchRemote( 
     394        get_newsletter_subscribe_base_url($language).$admin_mail, 
     395        $result, 
     396        array(), 
     397        array('origin' => 'installation') 
     398        ); 
     399    } 
    384400  } 
    385401} 
     
    411427    'F_ADMIN' => $admin_name, 
    412428    'F_ADMIN_EMAIL' => $admin_mail, 
     429    'EMAIL' => '<span class="adminEmail">'.$admin_mail.'</span>', 
     430    'F_NEWSLETTER_SUBSCRIBE' => $is_newsletter_subscribe, 
    413431    'L_INSTALL_HELP' => sprintf(l10n('Need help ? Ask your question on <a href="%s">Piwigo message board</a>.'), PHPWG_URL.'/forum'), 
    414432    )); 
     
    451469    log_user($user['id'], false); 
    452470  } 
    453  
    454   $template->assign( 
    455     'SUBSCRIBE_BASE_URL', 
    456     get_newsletter_subscribe_base_url($language) 
    457     ); 
    458471} 
    459472if (count($errors) != 0) 
Note: See TracChangeset for help on using the changeset viewer.