home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / HTML / Template / Flexy / Token / Text.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  1.9 KB  |  55 lines

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2002 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.02 of the PHP license,      |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors:  Alan Knowles <alan@akbkhome>                               |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: Text.php,v 1.13 2006/10/25 07:44:07 alan_k Exp $
  20. //
  21.  
  22.  
  23. /**
  24. * Class that represents a text string node.
  25. *
  26. */
  27.  
  28. class HTML_Template_Flexy_Token_Text extends HTML_Template_Flexy_Token {
  29.      
  30.      
  31.     /**
  32.     * Simple check to see if this piece of text is a word 
  33.     * so that gettext and the merging tricks dont try
  34.     * - merge white space with a flexy tag
  35.     * - gettext doesnt translate   etc.
  36.     *
  37.     * @return   boolean  true if this is a word
  38.     * @access   public
  39.     */
  40.     function isWord() {
  41.         if (!strlen(trim($this->value))) {
  42.             return false;
  43.         }
  44.         if (preg_match('/^\&[a-z0-9]+;$/i',trim($this->value))) {
  45.             return false;
  46.         }
  47.         return  preg_match('/\w/i',$this->value);
  48.     }
  49.      
  50. }
  51.  
  52.  
  53.   
  54.