Changeset 393
- Timestamp:
- Nov 29, 2011 4:02:29 PM (12 years ago)
- Location:
- trunk/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/CSS.inc.php
r376 r393 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2010 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 36 36 // CSS object parameters. 37 37 var $_params = array( 38 'cache_css' => true,39 38 'character_set' => 'utf-8', 39 'cache_css' => false, 40 'strip_whitespace' => false, 41 'output_compression' => false, 40 42 ); 41 43 … … 49 51 { 50 52 $app =& App::getInstance(); 51 53 52 54 if (isset($params) && is_array($params)) { 53 55 // Merge new parameters with old overriding only those passed. … … 68 70 { 69 71 $app =& App::getInstance(); 70 72 71 73 if (isset($this->_params[$param])) { 72 74 return $this->_params[$param]; … … 88 90 { 89 91 $app =& App::getInstance(); 90 92 91 93 if (!is_array($realms)) { 92 94 $realms = array($realms); … … 116 118 { 117 119 $app =& App::getInstance(); 118 120 119 121 $realm = '' == $realm ? 'default' : $realm; 120 122 … … 132 134 $latest_mtime = array_pop($files_mtime); 133 135 134 if ($this->_params['cache_css']) { 136 if ($this->getParam('output_compression') && extension_loaded('zlib')) { 137 ob_start('ob_gzhandler'); 138 } 139 140 if ($this->getParam('cache_css')) { 135 141 header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $latest_mtime) . ' GMT'); 136 142 header('Cache-Control: public, max-age=86400'); … … 140 146 header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); 141 147 } 142 header('Content-Type: text/css; charset=' . $this-> _params['character_set']);148 header('Content-Type: text/css; charset=' . $this->getParam('character_set')); 143 149 } 144 150 … … 160 166 161 167 foreach ($this->_css_files[$realm] as $file) { 162 include $file; 168 if ($this->getParam('strip_whitespace')) { 169 // Strip whitespace and print file. 170 echo preg_replace('/[ \t\n\r]+/', ' ', file_get_contents($file, true)); 171 } else { 172 // Include file as is. 173 include $file; 174 } 175 } 176 177 if ($this->getParam('output_compression') && extension_loaded('zlib')) { 178 ob_end_flush(); 163 179 } 164 180 } 165 166 181 } 167 182 ?> -
trunk/lib/FormValidator.inc.php
r376 r393 174 174 * Prints the HTML for displaying error messages. 175 175 * 176 * @param string $above Additional message to print above error messages (e.g. "Oops!"). 177 * @param string $below Additional message to print below error messages (e.g. "Please fix and resubmit"). 176 178 * @access public 177 179 * @author Quinn Comendant <quinn@strangecode.com> 178 180 * @since 15 Jul 2005 01:39:14 179 181 */ 180 function printErrorMessages( )182 function printErrorMessages($above='', $below='') 181 183 { 182 184 $app =& App::getInstance(); 183 185 if ($this->anyErrors()) { 184 186 ?><div class="sc-msg" id="sc-msg-formvalidator"><?php 187 if ('' != $above) { 188 ?><div class="sc-above"><?php echo oTxt($above); ?></div><?php 189 } 185 190 foreach ($this->getErrorList() as $e) { 186 191 if ('' != $e['message'] && is_string($e['message'])) { … … 208 213 } 209 214 } 215 if ('' != $below) { 216 ?><div class="sc-below"><?php echo oTxt($below); ?></div><?php 217 } 210 218 ?></div><?php 211 219 } -
trunk/lib/Navigation.inc.php
r376 r393 281 281 function currentPage($page_uri, $return=true) 282 282 { 283 // $page_uri = str_replace('/', '\/', $page_uri);284 283 if (preg_match('/^' . preg_quote(urldecode($page_uri), '/') . '/i', $_SERVER['PHP_SELF'])) { 285 284 return $return;
Note: See TracChangeset
for help on using the changeset viewer.