Changing our coding standards slightly:
[isso.git] / Template.php
index 6fb6314ce750f4e57b9879f9c267862b577846a3..b15d749219200d6852f286a8ebaa896e92f6ae94 100644 (file)
@@ -177,7 +177,7 @@ class BSTemplate
                                        $dbCache["$tpl[filename]"] = $template;
                                }
                        }
-                       foreach ($namearray AS $name)
+                       foreach ($namearray as $name)
                        {
                                if ($this->dbCacheTable)
                                {
@@ -255,7 +255,7 @@ class BSTemplate
                        
                        if (sizeof($this->uncached) > 0)
                        {
-                               foreach ($this->uncached AS $name => $count)
+                               foreach ($this->uncached as $name => $count)
                                {
                                        $tpls[] = $name . "($count)";
                                }
@@ -268,7 +268,7 @@ class BSTemplate
                                
                                $debugBlock .= "<br />\n" . '<table cellpadding="4" cellspacing="1" border="0" align="center" width="30%" style="background-color: rgb(60, 60, 60); color: white">' . "\n\t" . '<tr><td><strong>Query Debug</strong></td></tr>';
                                
-                               foreach ($queries AS $query)
+                               foreach ($queries as $query)
                                {
                                        $debugBlock .= "\n\t<tr style=\"background-color: rgb(230, 230, 230); color: black\">";
                                        $debugBlock .= "\n\t\t<td>";
@@ -295,7 +295,7 @@ class BSTemplate
        protected function _loadTemplate($name)
        {
                $path = $this->templateDir . $name . '.' . $this->extension;
-               if (is_file($path) AND is_readable($path))
+               if (is_file($path) && is_readable($path))
                {
                        return @file_get_contents($path);
                }
@@ -346,7 +346,7 @@ class BSTemplate
                        for ($i = 0; $i < strlen($template); $i++)
                        {
                                // we've run through the template and there's nothing in the stack--done
-                               if ($i == strlen($template) - 1 AND sizeof($stack) == 0)
+                               if ($i == strlen($template) - 1 && sizeof($stack) == 0)
                                {
                                        return $template;
                                }
@@ -398,7 +398,7 @@ class BSTemplate
                $token = substr($token, 1, strlen($token) - 2);
                
                // language token
-               if ($token[0] == '@' AND $token[1] == '\\' AND $token[2] == '"')
+               if ($token[0] == '@' && $token[1] == '\\' && $token[2] == '"')
                {
                        return '" . ' . $this->langcall . '(\'' . str_replace(array('\\\"', "'"), array('"', "\'"), substr($token, 3, strlen($token) - 5)) . '\')' . ' . "';
                }
@@ -475,7 +475,7 @@ class BSTemplate
                                                throw new Exception('Invalid language variable index "' . $capture . '"');
                                        }
                                }
-                               else if ($template[$i] == '>' AND $template[$i - 1] == '"')
+                               else if ($template[$i] == '>' && $template[$i - 1] == '"')
                                {
                                        // the final variable substitution
                                        $varMap[intval($varNum)] = BSFunctions::substring($template, $capturePos + 3, $i - 2);
@@ -568,7 +568,7 @@ class BSTemplate
                                // locate else tags
                                else if (substr($template, $i, strlen($tag_else)) == $tag_else)
                                {
-                                       if (sizeof($stack) == 0 AND !isset($tag_full['else']))
+                                       if (sizeof($stack) == 0 && !isset($tag_full['else']))
                                        {
                                                $tag_full['else'] = $i;
                                        }