Changeset 1676


Ignore:
Timestamp:
Dec 19, 2006, 11:05:01 PM (17 years ago)
Author:
rub
Message:

Apply Nicco's style footer to HTML mail.
Add 2 news functions to indicate to build URL with full path

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_notification_by_mail.inc.php

    r1645 r1676  
    313313function get_mail_content_subscribe_unsubcribe($nbm_user)
    314314{
    315   global $page, $env_nbm;
     315  global $env_nbm;
    316316 
    317317  $content = "\n\n\n";
    318318 
    319   if ( isset($page['root_path']) )
    320   {
    321     $save_root_path = $page['root_path'];
    322   }
    323 
    324   $page['root_path'] = 'http://'.$_SERVER['HTTP_HOST'].cookie_path();
     319  set_make_full_url();
    325320 
    326321  $content .= "___________________________________________________\n\n";
     
    330325  $content .= "___________________________________________________\n\n\n\n";
    331326
    332   if (isset($save_root_path))
    333   {
    334     $page['root_path'] = $save_root_path;
    335   }
    336   else
    337   {
    338     unset($page['root_path']);
    339   }
     327  unset_make_full_url();
    340328
    341329  return $content;
  • trunk/include/functions_mail.inc.php

    r1645 r1676  
    122122function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $format_infos = 'text/plain', $email_format = null)
    123123{
    124   global $conf, $conf_mail, $lang_info, $user;
     124  global $conf, $conf_mail, $lang_info, $user, $page;
    125125
    126126  $cvt7b_subject = str_translate_to_ascii7bits($subject);
     
    140140    // Todo find function to convert html text to plain text
    141141    return false;
     142  }
     143
     144  // Compute root_path in order have complete path
     145  if ($email_format == 'text/html')
     146  {
     147    set_make_full_url();
    142148  }
    143149
     
    180186
    181187          'CONTENT_ENCODING' => $lang_info['charset'],
    182           'LANG'=>$lang_info['code'],
    183           'DIR'=>$lang_info['direction']
    184 
     188          'LANG' => $lang_info['code'],
     189          'DIR' => $lang_info['direction']
    185190          ));
    186191
     
    221226          'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '',
    222227
    223           'L_TITLE_MAIL' => urlencode(l10n('title_send_mail')),
     228          'TITLE_MAIL' => urlencode(l10n('title_send_mail')),
    224229          'MAIL' => get_webmaster_mail_address()
    225230          ));
     
    235240
    236241  $content.= $conf_mail[$email_format][$lang_info['charset']]['footer'];
     242 
     243   // Undo Compute root_path in order have complete path
     244  if ($email_format == 'text/html')
     245  {
     246    unset_make_full_url();
     247  }
    237248
    238249  if ($conf_mail['mail_options'])
  • trunk/include/functions_url.inc.php

    r1566 r1676  
    397397  return $section_string;
    398398}
     399
     400/**
     401 * Indicate to build url with full path
     402 *
     403 * @param null
     404 * @return null
     405 */
     406function set_make_full_url()
     407{
     408  global $page;
     409
     410  if (!isset($page['save_root_path']))
     411  {
     412    if (isset($page['root_path']))
     413    {
     414      $page['save_root_path']['path'] = $page['root_path'];
     415    }
     416    $page['save_root_path']['count'] = 1;
     417    $page['root_path'] = 'http://'.$_SERVER['HTTP_HOST'].cookie_path();
     418  }
     419  else
     420  {
     421    $page['save_root_path']['count'] += 1;
     422  }
     423}
     424
     425/**
     426 * Restore old parameter to build url with full path
     427 *
     428 * @param null
     429 * @return null
     430 */
     431function unset_make_full_url()
     432{
     433  global $page;
     434
     435  if (isset($page['save_root_path']))
     436  {
     437    if ($page['save_root_path']['count'] == 1)
     438    {
     439      if (isset($page['save_root_path']['path']))
     440      {
     441        $page['root_path'] = $page['save_root_path']['path'];
     442      }
     443      else
     444      {
     445        unset($page['root_path']);
     446      }
     447      unset($page['save_root_path']);
     448    }
     449    else
     450    {
     451      $page['save_root_path']['count'] -= 1;
     452    }
     453  }
     454}
     455
    399456?>
  • trunk/template/yoga/mail/footer.tpl

    r1645 r1676  
    66
    77  <a href="{GALLERY_URL}" class="back">{GALLERY_TITLE}</a> -
    8   {lang:powered_by} <a href="http://www.phpwebgallery.net" class="back">PhpWebGallery</a>
     8  <a href="http://www.phpwebgallery.net" class="back" title="{lang:powered_by}">
     9    <img src="{pwg_root}{themeconf:icon_dir}/pwg_footer.png" alt="{lang:powered_by}">
     10  </a>
    911  {VERSION}
    1012  - {lang:send_mail}
    11   <a href="mailto:{MAIL}?subject={L_TITLE_MAIL}">{lang:Webmaster}</a>
     13  <a href="mailto:{MAIL}?subject={TITLE_MAIL}">{lang:Webmaster}</a>
    1214
    1315</div> <!-- copyright -->
Note: See TracChangeset for help on using the changeset viewer.