diff --git a/AUTHORS b/AUTHORS index 0bdd7511..fc69abe2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -6,4 +6,5 @@ Monte Ohrt Andrei Zmievski - rewrote parser from scratch - maintains code base + - plugin architecture - wrote Config_File class diff --git a/CREDITS b/CREDITS index 74c7a447..d0f4f969 100644 --- a/CREDITS +++ b/CREDITS @@ -3,7 +3,8 @@ Monte Ohrt : concept" implementation, and maintains documentation & code base. Andrei Zmievski : - Rewrote parser from scratch and maintains code base. + Rewrote parser from scratch, developed plugin architecture, and maintains + code base. Anne Holz : Provided creative input with respect to web design. @@ -18,5 +19,5 @@ A special thanks goes to the members of the php-template mailing list and the smarty mailing list, too numerous to list, who are sharing and bringing many ideas to the table and contributing source code. -Rasmus Lerdorf : For starting what eventually became -the coolest programming language ever. +Rasmus Lerdorf : For starting what eventually became the +coolest programming language ever. diff --git a/Config_File.class.php b/Config_File.class.php index ade62e9f..d4cc3ce4 100644 --- a/Config_File.class.php +++ b/Config_File.class.php @@ -9,7 +9,7 @@ require_once "PEAR.php"; * @author Andrei Zmievski * @access public * - * Copyright: 2001 ispi of Lincoln, Inc. + * Copyright: 2001,2002 ispi of Lincoln, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/README b/README index 0a921bea..31006ce5 100644 --- a/README +++ b/README @@ -64,6 +64,6 @@ DESCRIPTION: * arbitrary template sources (flat files, databases, etc.) COPYRIGHT: - Copyright (c) 2001 ispi of Lincoln, Inc. All rights reserved. + Copyright (c) 2001,2002 ispi of Lincoln, Inc. All rights reserved. This software is released under the GNU Lesser General Public License. Please read the disclaimer at the top of the Smarty.class.php file. diff --git a/Smarty.addons.php b/Smarty.addons.php deleted file mode 100644 index 8daa4277..00000000 --- a/Smarty.addons.php +++ /dev/null @@ -1,891 +0,0 @@ - - * Andrei Zmievski - * Version: 1.5.2 - * Copyright: 2001 ispi of Lincoln, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * You may contact the authors of Smarty by e-mail at: - * monte@ispi.net - * andrei@php.net - * - * Or, write to: - * Monte Ohrt - * Directory of Technology, ispi - * 237 S. 70th suite 220 - * Lincoln, NE 68510 - * - * The latest version of Smarty can be obtained from: - * http://www.phpinsider.com - * - */ - - -/*============================================*\ - Modifiers -\*============================================*/ - -/*======================================================================*\ - Function: smarty_mod_escape - Purpose: Escape the string according to escapement type -\*======================================================================*/ -function smarty_mod_escape($string, $esc_type = 'html') -{ - switch ($esc_type) { - case 'html': - return htmlspecialchars($string, ENT_QUOTES); - - case 'url': - return urlencode($string); - - case 'quotes': - // escape unescaped single quotes - return preg_replace("%(? $length) { - $length -= strlen($etc); - $fragment = substr($string, 0, $length+1); - if ($break_words) - $fragment = substr($fragment, 0, -1); - else - $fragment = preg_replace('/\s+(\S+)?$/', '', $fragment); - return $fragment.$etc; - } else - return $string; -} - - -/*======================================================================*\ - Function: smarty_mod_spacify - Purpose: add spaces between characters in a string -\*======================================================================*/ -function smarty_mod_spacify($string, $spacify_char = ' ') -{ - return implode($spacify_char, preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY)); -} - -/*======================================================================*\ - Function: smarty_mod_date_format - Purpose: format datestamps via strftime -\*======================================================================*/ -function smarty_mod_date_format($string, $format="%b %e, %Y") -{ - return strftime($format, smarty_make_timestamp($string)); -} - -/*======================================================================*\ - Function: smarty_make_timestamp - Purpose: used by other smarty functions to make a timestamp - from a string of characters. -\*======================================================================*/ -function smarty_make_timestamp($string) -{ - if(empty($string)) { - $string = "now"; - } - $time = strtotime($string); - if (is_numeric($time) && $time != -1) - return $time; - - // is mysql timestamp format of YYYYMMDDHHMMSS? - if (is_numeric($string) && strlen($string) == 14) { - $time = mktime(substr($string,8,2),substr($string,10,2),substr($string,12,2), - substr($string,4,2),substr($string,6,2),substr($string,0,4)); - - return $time; - } - - // can't decipher, just return it - return $string; -} - -/*======================================================================*\ - Function: smarty_mod_string_format - Purpose: format strings via sprintf -\*======================================================================*/ -function smarty_mod_string_format($string, $format) -{ - return sprintf($format, $string); -} - -/*======================================================================*\ - Function: smarty_mod_replace - Purpose: simple search/replace -\*======================================================================*/ -function smarty_mod_replace($string, $search, $replace) -{ - return str_replace($search, $replace, $string); -} - -/*======================================================================*\ - Function: smarty_mod_regex_replace - Purpose: regular epxression search/replace -\*======================================================================*/ -function smarty_mod_regex_replace($string, $search, $replace) -{ - return preg_replace($search, $replace, $string); -} - -/*======================================================================*\ - Function: smarty_mod_strip_tags - Purpose: strip html tags from text -\*======================================================================*/ -function smarty_mod_strip_tags($string, $replace_with_space = true) -{ - if ($replace_with_space) - return preg_replace('!<[^>]*?>!', ' ', $string); - else - return strip_tags($string); -} - -/*======================================================================*\ - Function: smarty_mod_default - Purpose: designate default text for empty variables -\*======================================================================*/ -function smarty_mod_default($string, $default="") -{ - if (empty($string)) - return $default; - else - return $string; -} - -/*======================================================================*\ - Function: smarty_func_assign - Purpose: assign a value to a template variable -\*======================================================================*/ -function smarty_func_assign($args, &$smarty_obj) -{ - extract($args); - - if (empty($var)) { - $smarty_obj->_trigger_error_msg("assign: missing 'var' parameter"); - return; - } - - if (!in_array('value', array_keys($args))) { - $smarty_obj->_trigger_error_msg("assign: missing 'value' parameter"); - return; - } - - $smarty_obj->assign($var, $value); - return true; -} - -/*============================================*\ - Custom tag functions -\*============================================*/ - -/*======================================================================*\ - Function: smarty_func_html_options - Purpose: Prints the list of