includes/template.php
changeset 279 b6faa6d6ade2
parent 272 27f5ac58992c
child 285 e72bf2c24875
equal deleted inserted replaced
278:2c6ef58e315a 279:b6faa6d6ade2
   151     
   151     
   152     if(isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
   152     if(isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
   153     {
   153     {
   154       $this->add_header('
   154       $this->add_header('
   155         <!--[if lt IE 7]>
   155         <!--[if lt IE 7]>
   156         <script language="JavaScript">
   156         <script type="text/javascript" src="' . scriptPath . '/includes/clientside/ie-png.js"></script>
   157         function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
       
   158         {
       
   159            var arVersion = navigator.appVersion.split("MSIE");
       
   160            var version = parseFloat(arVersion[1]);
       
   161            if (version >= 5.5 && typeof(document.body.filters) == "object")
       
   162            {
       
   163               for(var i=0; i<document.images.length; i++)
       
   164               {
       
   165                  var img = document.images[i];
       
   166                  continue;
       
   167                  var imgName = img.src.toUpperCase();
       
   168                  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
       
   169                  {
       
   170                     var imgID = (img.id) ? "id=\'" + img.id + "\' " : "";
       
   171                     var imgClass = (img.className) ? "class=\'" + img.className + "\' " : "";
       
   172                     var imgTitle = (img.title) ? "title=\'" + img.title + "\' " : "title=\'" + img.alt + "\' ";
       
   173                     var imgStyle = "display:inline-block;" + img.style.cssText;
       
   174                     if (img.align == "left") imgStyle = "float:left;" + imgStyle;
       
   175                     if (img.align == "right") imgStyle = "float:right;" + imgStyle;
       
   176                     if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
       
   177                     var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\\\'" + img.src + "\\\', sizingMethod=\'scale\');\\"></span>";
       
   178                     img.outerHTML = strNewHTML;
       
   179                     i = i-1;
       
   180                  }
       
   181               }
       
   182            }   
       
   183         }
       
   184         window.attachEvent("onload", correctPNG);
       
   185         </script>
       
   186         <![endif]-->
   157         <![endif]-->
   187         ');
   158         ');
   188     }
   159     }
   189     
   160     
   190     // Get the "article" button text (depends on namespace)
   161     // Get the "article" button text (depends on namespace)
   905     
   876     
   906     // Sometimes this function gets called before the theme is loaded
   877     // Sometimes this function gets called before the theme is loaded
   907     // This is a bad coding practice so this function will always be picky.
   878     // This is a bad coding practice so this function will always be picky.
   908     if ( !$this->theme )
   879     if ( !$this->theme )
   909     {
   880     {
   910       die('$template->extract_vars(): theme not yet loaded, so we can\'t open template files yet...this is a bug and should be reported.<br /><br />Backtrace, most recent call first:<pre>'.enano_debug_print_backtrace(true).'</pre>');
   881       die('$template->extract_vars(): theme (' . $this->theme . ') not yet loaded, so we can\'t open template files yet...this is a bug and should be reported.<br /><br />Backtrace, most recent call first:<pre>'.enano_debug_print_backtrace(true).'</pre>');
   911     }
   882     }
   912     
   883     
   913     // Full pathname of template file
   884     // Full pathname of template file
   914     $tpl_file_fullpath = ENANO_ROOT . '/themes/' . $this->theme . '/' . $file;
   885     $tpl_file_fullpath = ENANO_ROOT . '/themes/' . $this->theme . '/' . $file;
   915     
   886     
  1070     //
  1041     //
  1071     // Data substitution/variables
  1042     // Data substitution/variables
  1072     //
  1043     //
  1073     
  1044     
  1074     // System messages
  1045     // System messages
  1075     $text = preg_replace('/<!-- SYSMSG ([A-z0-9\._-]+?) -->/is', '\' . $this->tplWikiFormat($paths->sysMsg(\'\\1\')) . \'', $text);
  1046     $text = preg_replace('/<!-- SYSMSG ([A-z0-9\._-]+?) -->/is', '\' . $template->tplWikiFormat($paths->sysMsg(\'\\1\')) . \'', $text);
  1076     
  1047     
  1077     // Template variables
  1048     // Template variables
  1078     $text = preg_replace('/\{([A-z0-9_-]+?)\}/is', '\' . $this->tpl_strings[\'\\1\'] . \'', $text);
  1049     $text = preg_replace('/\{([A-z0-9_-]+?)\}/is', '\' . $this->tpl_strings[\'\\1\'] . \'', $text);
  1079     
  1050     
  1080     // Reinsert PHP
  1051     // Reinsert PHP