Changeset 20421
- Timestamp:
- Jan 27, 2013, 2:34:55 PM (12 years ago)
- Location:
- extensions/Piwecard
- Files:
-
- 1 added
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/Piwecard/admin/template/admin_configuration.tpl
r20341 r20421 24 24 if (data.stat =='ok') { 25 25 $("#previewEmail").html(data.result.message); 26 $.each(data.result.style, function(index, value) {27 document.getElementById(index).setAttribute("style", value);28 });29 26 $.colorbox({ 30 27 inline:true, 31 28 href:"#previewEmail", 32 onComplete: function( style){29 onComplete: function(){ 33 30 $("#cboxLoadedContent").css('text-align', 'left'); 34 31 } -
extensions/Piwecard/include/parse_param.inc.php
r20412 r20421 3 3 set_make_full_url(); 4 4 5 // Fichier contenant les parametres du plugin (pour le parser)5 //Parser parameters 6 6 $ecard_parse = array( 7 7 '%yourname%' => isset($values['ecard_sender_name']) ? $values['ecard_sender_name'] : '' , … … 15 15 '%ecardmessage%' => isset($values['ecard_message']) ? $values['ecard_message'] : '' , 16 16 '%pictureurl%' => DerivativeImage::thumb_url($image_element) , 17 '%pictureinfos%' => isset($image_element['picture_infos']) ? $image_element['picture_infos']: '' ,17 '%pictureinfos%' => isset($image_element['picture_infos']) ? '<small>'.$image_element['picture_infos'].'</small>' : '' , 18 18 ); 19 19 -
extensions/Piwecard/include/piwecard.class.php
r20341 r20421 72 72 73 73 function parse($data, $values, $image_element) { 74 include (PIWECARD_PATH.'include/ config_param.inc.php');74 include (PIWECARD_PATH.'include/parse_param.inc.php'); 75 75 76 76 $patterns = array(); -
extensions/Piwecard/mail/template/mail_html.tpl
r20341 r20421 22 22 padding: 30px 0px 0px 30px; 23 23 width: 732px; 24 border: none; 24 25 } 25 .email_hr {26 #email_hr { 26 27 width: 632px; 27 28 margin-left: 0; … … 45 46 </div> 46 47 <div id="email_copyright"> 47 <hr class="email_hr" />48 <hr id="email_hr" /> 48 49 {'Sent by'|@translate} 49 50 <a href="{$GALLERY_URL}">{$GALLERY_TITLE}</a> -
extensions/Piwecard/template/ecard.tpl
r20292 r20421 120 120 {/literal}{/footer_script} 121 121 122 </p>123 122 <div style="display:none"> 124 123 <div id="addECardForm"> … … 195 194 </div> 196 195 </div> 197 < p>196 <div> 198 197 <a href="#" class="createECardOpen" id="createECardOpen" title="{'piwecard_send_link'|@translate}">{'piwecard_send_link'|@translate}</a> 199 </ p><p>198 </div> -
extensions/Piwecard/ws/ws_functions.inc.php
r20341 r20421 26 26 27 27 if ($format_message == 'text') { 28 $message_output = nl2br($piwecard->get_text_message( $message, $smarty));28 $message_output = nl2br($piwecard->get_text_message(stripslashes(parse($message)), $smarty)); 29 29 $style = ''; 30 30 } elseif ($format_message == 'html') { 31 $output = $piwecard->get_html_message( $message, $smarty);31 $output = $piwecard->get_html_message(stripslashes(parse($message)), $smarty); 32 32 $dom_document = new DOMDocument(); 33 33 $dom_document->loadHTML($output); 34 $style = piwecard_create_style_array($dom_document->getElementsByTagName('style')->item(0)->nodeValue); 35 $message_output = $dom_document->saveHTML($dom_document->getElementsByTagName('body')->item(0)); 36 $message_output = '<div id="email_body">'.$message_output.'</div>'; 34 $styles = piwecard_create_style_array($dom_document->getElementsByTagName('style')->item(0)->nodeValue); 35 $message_output = $dom_document->getElementsByTagName('body')->item(0); 36 $email_body = $dom_document->createElement('div'); 37 $email_body->setAttribute('id', 'email_body'); 38 $message_output->parentNode->insertBefore($email_body, $message_output); 39 $email_body->appendChild($message_output); 40 foreach ($styles as $id => $style) { 41 $dom_document->getElementById(str_replace('#', '', $id))->setAttribute("style", $style); 42 } 43 $message_output = $dom_document->saveHTML(); 37 44 } 38 45 39 return array('message' => $message_output , 'style' => $style);46 return array('message' => $message_output); 40 47 } 41 48 … … 58 65 return $styles; 59 66 } 67 68 function parse($data) { 69 global $conf; 70 71 set_make_full_url(); 72 $ecard_parse = array( 73 '%yourname%' => 'Your Name', 74 '%youremail%' => 'Your email', 75 '%recipientname%' => 'Recipient name', 76 '%recipientemail%' => 'Recipient email', 77 '%website%' => isset($conf['gallery_title']) ? $conf['gallery_title'] : '' , 78 '%websiteurl%' => get_absolute_root_url() , 79 '%ecardurl%' => '', 80 '%ecardtitle%' => 'Ecard title', 81 '%ecardmessage%' => 'The message of the ecard', 82 '%pictureurl%' => get_root_url().PIWECARD_PATH.'admin/images/image_thumb.jpg', 83 '%pictureinfos%' => '<small>Image infos</small>', 84 ); 85 unset_make_full_url(); 86 87 $patterns = array(); 88 $replacements = array(); 89 foreach ($ecard_parse as $key => $value) { 90 array_push($patterns, $key); 91 array_push($replacements, $value); 92 } 93 94 return str_replace($patterns, $replacements, $data); 95 } 60 96 ?>
Note: See TracChangeset
for help on using the changeset viewer.