Changeset 2278
- Timestamp:
- Mar 13, 2008, 2:43:45 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/maintenance.php
r2251 r2278 107 107 case 'compiled-templates' : 108 108 { 109 $template->smarty->clear_compiled_tpl(); 110 file_put_contents($template->smarty->compile_dir.'/index.htm', ''); 109 $template->delete_compiled_templates(); 111 110 break; 112 111 } -
trunk/include/functions_mail.inc.php
r2262 r2278 171 171 * o theme: template to use [default get_default_template()] 172 172 */ 173 function get_mail_template($email_format, $args = array())173 function & get_mail_template($email_format, $args = array()) 174 174 { 175 175 $args = get_array_template_theme($args); 176 176 177 177 $mail_template = new Template(PHPWG_ROOT_PATH.'template/'.$args['template'], $args['theme']); 178 $mail_template->_old->set_rootdir(PHPWG_ROOT_PATH.'template/'.$args['template'].'/mail/'.$email_format); 179 $mail_template->smarty->template_dir = PHPWG_ROOT_PATH.'template/'.$args['template'].'/mail/'.$email_format; 180 178 $mail_template->set_template_dir(PHPWG_ROOT_PATH.'template/'.$args['template'].'/mail/'.$email_format); 181 179 return $mail_template; 182 180 } … … 298 296 { 299 297 // Check arguments 300 if 298 if 301 299 ( 302 300 empty($keyargs_subject) or … … 392 390 { 393 391 // Check arguments 394 if 392 if 395 393 ( 396 394 empty($group_id) or … … 476 474 (empty($dirname) ? '' : $dirname.'/').$tpl_shortname.'.tpl'); 477 475 478 $mail_template->assign _vars(476 $mail_template->assign( 479 477 trigger_event('mail_group_assign_vars', $assign_vars)); 480 478 … … 630 628 $mail_template->set_filename('mail_footer', 'footer.tpl'); 631 629 632 $mail_template->assign _vars(630 $mail_template->assign( 633 631 array( 634 632 //Header … … 655 653 if ($args['email_format'] == 'text/html') 656 654 { 657 $old_root = $mail_template->root; 658 659 if (is_file($mail_template->root.'/global-mail-css.tpl')) 655 if (is_file($mail_template->get_template_dir().'/global-mail-css.tpl')) 660 656 { 661 $mail_template->set_filename(' global_mail_css', 'global-mail-css.tpl');662 $mail_template->assign_var_from_handle('GLOBAL_MAIL_CSS', ' global_mail_css');657 $mail_template->set_filename('css', 'global-mail-css.tpl'); 658 $mail_template->assign_var_from_handle('GLOBAL_MAIL_CSS', 'css'); 663 659 } 664 660 665 $mail_template->root = PHPWG_ROOT_PATH.'template/'.$args['template'].'/theme/'.$args['theme']; 666 if (is_file($mail_template->root.'/mail-css.tpl')) 661 $root_abs_path = dirname(dirname(__FILE__)); 662 663 $file = $root_abs_path.'/template/'.$args['template'].'/theme/'.$args['theme'].'/mail-css.tpl'; 664 if (is_file($file)) 667 665 { 668 $mail_template->set_filename(' mail_css', 'mail-css.tpl');669 $mail_template->assign_var_from_handle('MAIL_CSS', ' mail_css');666 $mail_template->set_filename('css', $file); 667 $mail_template->assign_var_from_handle('MAIL_CSS', 'css'); 670 668 } 671 669 672 $ mail_template->root = PHPWG_ROOT_PATH.'template-common';673 if (is_file($ mail_template->root.'/local-mail-css.tpl'))670 $file = $root_abs_path.'/template-common/local-mail-css.tpl'; 671 if (is_file($file)) 674 672 { 675 $mail_template->set_filename(' local_mail_css', 'local-mail-css.tpl');676 $mail_template->assign_var_from_handle('LOCAL_MAIL_CSS', ' local_mail_css');673 $mail_template->set_filename('css', $file); 674 $mail_template->assign_var_from_handle('LOCAL_MAIL_CSS', 'css'); 677 675 } 678 679 $mail_template->root = $old_root;680 676 } 681 677 … … 771 767 } 772 768 773 /*Testing block 774 function pwg_send_mail_test($result, $to, $subject, $content, $headers, $args) 775 { 776 global $user, $lang_info; 777 @mkdir(PHPWG_ROOT_PATH.'testmail'); 778 $filename = PHPWG_ROOT_PATH.'testmail/mail.'.$user['username'].'.'.$lang_info['code'].'.'.$args['template'].'.'.$args['theme']; 769 /*Testing block*/ 770 /*function pwg_send_mail_test($result, $to, $subject, $content, $headers, $args) 771 { 772 global $conf, $user, $lang_info; 773 $dir = $conf['local_data_dir'].'/tmp'; 774 @mkdir( $dir ); 775 $filename = $dir.'/mail.'.$user['username'].'.'.$lang_info['code'].'.'.$args['template'].'.'.$args['theme']; 779 776 if ($args['content_format'] == 'text/plain') 780 777 { … … 786 783 } 787 784 $file = fopen($filename, 'w+'); 788 fwrite($file, $to );789 fwrite($file, $subject );785 fwrite($file, $to ."\n"); 786 fwrite($file, $subject ."\n"); 790 787 fwrite($file, $headers); 791 788 fwrite($file, $content); 792 789 fclose($file); 793 return true;794 } 795 add_event_handler('send_mail', 'pwg_send_mail_test', 0, 6);*/790 return $result; 791 } 792 add_event_handler('send_mail', 'pwg_send_mail_test', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 6);*/ 796 793 797 794 -
trunk/include/template.class.php
r2254 r2278 79 79 $this->smarty->compile_dir = $compile_dir; 80 80 81 $this->smarty->template_dir = $root;82 81 $this->smarty->register_function( 'lang', array('Template', 'fn_l10n') ); 83 82 … … 92 91 93 92 $this->_old = & new TemplateOld($root, $theme); 93 94 $this->set_template_dir($root); 95 } 96 97 /** 98 * Sets the template root directory for this Template object. 99 */ 100 function set_template_dir($dir) 101 { 102 $this->_old->set_rootdir($dir); 103 $this->smarty->template_dir = $dir; 104 105 $real_dir = realpath($dir); 106 $compile_id = crc32( $real_dir===false ? $dir : $real_dir); 107 $this->smarty->compile_id = sprintf('%08X', $compile_id ); 108 } 109 110 /** 111 * Gets the template root directory for this Template object. 112 */ 113 function get_template_dir() 114 { 115 return $this->smarty->template_dir; 116 } 117 118 /** 119 * Deletes all compiled templates. 120 */ 121 function delete_compiled_templates() 122 { 123 $save_compile_id = $this->smarty->compile_id; 124 $this->smarty->compile_id = null; 125 $this->smarty->clear_compiled_tpl(); 126 $this->smarty->compile_id = $save_compile_id; 127 file_put_contents($this->smarty->compile_dir.'/index.htm', ''); 94 128 } 95 129 -
trunk/nbm.php
r2126 r2278 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 7PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | file : $Id$ … … 73 73 $template->set_filenames(array('nbm'=>'nbm.tpl')); 74 74 75 $template->assign_vars(array('U_HOME' => make_index_url()));76 77 75 // +-----------------------------------------------------------------------+ 78 76 // | errors & infos | 79 77 // +-----------------------------------------------------------------------+ 80 if (count($page['errors']) != 0) 81 { 82 $template->assign_block_vars('errors',array()); 83 foreach ($page['errors'] as $error) 84 { 85 $template->assign_block_vars('errors.error',array('ERROR'=>$error)); 86 } 87 } 88 89 if (count($page['infos']) != 0) 90 { 91 $template->assign_block_vars('infos',array()); 92 foreach ($page['infos'] as $info) 93 { 94 $template->assign_block_vars('infos.info',array('INFO'=>$info)); 95 } 96 } 78 $template->assign( 79 array( 80 'errors' => $page['errors'], 81 'infos' => $page['infos'], 82 ) 83 ); 97 84 98 85 // +-----------------------------------------------------------------------+ -
trunk/template/yoga/mail/text/html/admin/cat_group_info.tpl
r2222 r2278 1 <!-- DEV TAG: not smarty migrated --> 1 {* $Id$ *} 2 2 <div id="cat_group_info"> 3 <h2>{ lang:Informations}</h2>4 <p>{ IMG_URL}</p>5 <p>{ lang:Hello,}</p>6 <p>{ lang:Come to discover the category:} <a href="{LINK}">{CAT_NAME}</a></p>7 <p>{ CPL_CONTENT}</p>8 <p>{ lang:See you soon.}</p>3 <h2>{'Informations'|@translate}</h2> 4 <p>{$IMG_URL}</p> 5 <p>{'Hello,'|@translate}</p> 6 <p>{'Come to discover the category:'|@translate} <a href="{$LINK}">{$CAT_NAME}</a></p> 7 <p>{$CPL_CONTENT}</p> 8 <p>{'See you soon.'|@translate}</p> 9 9 </div> -
trunk/template/yoga/mail/text/html/footer.tpl
r2222 r2278 1 <!-- DEV TAG: not smarty migrated --> 1 {* $Id$ *} 2 2 </div> <!-- content --> 3 3 <div id="copyright"> 4 < HR>5 <!--Please, do not remove this copyright. If you really want to,4 <hr/> 5 {* Please, do not remove this copyright. If you really want to, 6 6 contact us on http://phpwebgallery.net to find a solution on how 7 to show the origin of the script... -->7 to show the origin of the script...*} 8 8 9 { lang:powered_by}9 {'powered_by'|@translate} 10 10 <a href="http://www.phpwebgallery.net" class="PWG"> 11 11 <span class="P">Php</span><span class="W">Web</span><span class="G">Gallery</span></a> 12 { VERSION}13 - { lang:send_mail}14 <a href="mailto:{ MAIL}?subject={TITLE_MAIL}">{lang:Webmaster}</a>12 {$VERSION} 13 - {'send_mail'|@translate} 14 <a href="mailto:{$MAIL}?subject={$TITLE_MAIL}">{'Webmaster'|@translate}</a> 15 15 16 16 </div> <!-- copyright --> -
trunk/template/yoga/mail/text/html/global-mail-css.tpl
r2222 r2278 1 <!-- DEV TAG: not smarty migrated --> 2 /* $Id$ */ 1 {* $Id$ *} 3 2 /* Global mail css */ 4 3 /* Including like css style on HTML mail */ 5 4 6 body {background-color:#fff;font-family: Univers, Helvetica, Optima;font-size:12px; margin:0px;padding:0px; color:#369;}7 #the_page { background: #fff url({pwg_root}template/{themeconf:template}/mail/text/html/images/mailbody-bg.png) repeat-y scroll left top;5 body {ldelim}background-color:#fff;font-family: Univers, Helvetica, Optima;font-size:12px; margin:0px;padding:0px; color:#369;} 6 #the_page {ldelim}background: #fff url({$ROOT_URL}template/{$themeconf.template}/mail/text/html/images/mailbody-bg.png) repeat-y scroll left top; 8 7 margin:0px;padding:0px;text-align: left;} 9 #content { background: transparent url({pwg_root}template/{themeconf:template}/mail/text/html/images/header-bg.png) no-repeat scroll left top;8 #content {ldelim}background: transparent url({$ROOT_URL}template/{$themeconf.template}/mail/text/html/images/header-bg.png) no-repeat scroll left top; 10 9 margin:0px;padding:82px 0px 0px 62px; width:732px;} 11 hr { width:632px;margin-left:0px;}12 #copyright { background: transparent url({pwg_root}template/{themeconf:template}/mail/text/html/images/footer-bg.png) no-repeat scroll left bottom;10 hr {ldelim}width:632px;margin-left:0px;} 11 #copyright {ldelim}background: transparent url({$ROOT_URL}template/{$themeconf.template}/mail/text/html/images/footer-bg.png) no-repeat scroll left bottom; 13 12 color: #69c;font-size:10px;margin:0px;padding:98px 0px 62px 62px;} 14 .PWG { font-family: verdana, sans-serif !important; font-size: 0.9em; font-weight: normal; letter-spacing: 0px;}15 h2 { 16 img { 17 img:hover { 18 a { 19 a:hover { 13 .PWG {ldelim}font-family: verdana, sans-serif !important; font-size: 0.9em; font-weight: normal; letter-spacing: 0px;} 14 h2 {ldelim}background-color:#ddd;padding: 7px 15px; width:617px;font-weight:bold;} 15 img {ldelim}margin: 16px; border: 16px solid #aaa; -moz-border-radius: 4px; border-radius: 4px 4px; } 16 img:hover {ldelim}padding: 15px; border: 1px solid yellow; -moz-border-radius: 4px; border-radius: 4px 4px; } 17 a {ldelim}color: #005e89; background: transparent; } 18 a:hover {ldelim}color: #858460; text-decoration: none;} -
trunk/template/yoga/mail/text/html/header.tpl
r2222 r2278 1 <!-- DEV TAG: not smarty migrated --> 2 -----={ BOUNDARY_KEY}3 Content-Type: { CONTENT_TYPE}; charset="{CONTENT_ENCODING}";1 {* $Id$ *} 2 -----={$BOUNDARY_KEY} 3 Content-Type: {$CONTENT_TYPE}; charset="{$CONTENT_ENCODING}"; 4 4 Content-Transfer-Encoding: 8bit 5 5 6 6 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 7 <html lang="{ LANG}" dir="{DIR}">7 <html lang="{$LANG}" dir="{$DIR}"> 8 8 <head> 9 9 <title>PhpWebGallery Mail</title> 10 <meta http-equiv="Content-Type" content="text/html; charset={ CONTENT_ENCODING}">10 <meta http-equiv="Content-Type" content="text/html; charset={$CONTENT_ENCODING}"> 11 11 <style><!-- /* Mini style for mails */ 12 { GLOBAL_MAIL_CSS}13 { MAIL_CSS}14 { LOCAL_MAIL_CSS}12 {if isset($GLOBAL_MAIL_CSS)}{$GLOBAL_MAIL_CSS}{/if} 13 {if isset($MAIL_CSS)}{$MAIL_CSS}{/if} 14 {if isset($LOCAL_MAIL_CSS)}{$LOCAL_MAIL_CSS}{/if} 15 15 --></style> 16 16 </head> -
trunk/template/yoga/mail/text/plain/admin/cat_group_info.tpl
r2222 r2278 1 <!-- DEV TAG: not smarty migrated --> 2 { lang:Hello,}1 {* $Id$ *} 2 {'Hello,'|@translate} 3 3 4 { lang:Come to discover the category:} {CAT_NAME}5 { LINK}4 {'Come to discover the category:'|@translate} {$CAT_NAME} 5 {$LINK} 6 6 7 { CPL_CONTENT}7 {$CPL_CONTENT} 8 8 9 { lang:See you soon.}9 {'See you soon.'|@translate} -
trunk/template/yoga/mail/text/plain/footer.tpl
r2222 r2278 1 <!-- DEV TAG: not smarty migrated --> 1 {* $Id$ *} 2 2 3 3 ------------------------ 4 PhpWebGallery { VERSION}4 PhpWebGallery {$VERSION} -
trunk/template/yoga/mail/text/plain/header.tpl
r2222 r2278 1 <!-- DEV TAG: not smarty migrated --> 2 -----={ BOUNDARY_KEY}3 Content-Type: { CONTENT_TYPE}; charset="{CONTENT_ENCODING}";1 {* $Id$ *} 2 -----={$BOUNDARY_KEY} 3 Content-Type: {$CONTENT_TYPE}; charset="{$CONTENT_ENCODING}"; 4 4 Content-Transfer-Encoding: 8bit -
trunk/template/yoga/nbm.tpl
r2222 r2278 1 <!-- DEV TAG: not smarty migrated --> 2 <!-- $Id$ --> 1 {* $Id$ *} 3 2 4 3 <div id="content"> 5 4 <div class="titrePage"> 6 5 <ul class="categoryActions"> 7 <li><a href="{ U_HOME}" title="{lang:Go through the gallery as a visitor}"><img src="{themeconf:icon_dir}/home.png" class="button" alt="{lang:home}"/></a></li>6 <li><a href="{$U_HOME}" title="{'Go through the gallery as a visitor'|@translate}"><img src="{$themeconf.icon_dir}/home.png" class="button" alt="{'home'|@translate}"/></a></li> 8 7 </ul> 9 <h2>{ lang:nbm_item_notification}</h2>8 <h2>{'nbm_item_notification'|@translate}</h2> 10 9 </div> 11 10 12 <!-- BEGIN errors -->11 {if not empty($errors)} 13 12 <div class="errors"> 14 13 <ul> 15 <!-- BEGIN error -->16 <li>{ errors.error.ERROR}</li>17 <!-- END error -->14 {foreach from=$errors item=error} 15 <li>{$error}</li> 16 {/foreach} 18 17 </ul> 19 18 </div> 20 <!-- END errors -->19 {/if} 21 20 22 <!-- BEGIN infos -->21 {if not empty($infos)} 23 22 <div class="infos"> 24 23 <ul> 25 <!-- BEGIN info -->26 <li>{ infos.info.INFO}</li>27 <!-- END info -->24 {foreach from=$infos item=info} 25 <li>{$info}</li> 26 {/foreach} 28 27 </ul> 29 28 </div> 30 <!-- END infos -->29 {/if} 31 30 32 31 </div>
Note: See TracChangeset
for help on using the changeset viewer.