Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
  1: <?php
  2: /**
  3:  * Smarty Internal Plugin Resource Extends
  4:  *
  5:  * @package    Smarty
  6:  * @subpackage TemplateResources
  7:  * @author     Uwe Tews
  8:  * @author     Rodney Rehm
  9:  */
 10: 
 11: /**
 12:  * Smarty Internal Plugin Resource Extends
 13:  * Implements the file system as resource for Smarty which {extend}s a chain of template files templates
 14:  *
 15:  * @package    Smarty
 16:  * @subpackage TemplateResources
 17:  */
 18: class Smarty_Internal_Resource_Extends extends Smarty_Resource
 19: {
 20:     /**
 21:      * mbstring.overload flag
 22:      *
 23:      * @var int
 24:      */
 25:     public $mbstring_overload = 0;
 26: 
 27:     /**
 28:      * populate Source Object with meta data from Resource
 29:      *
 30:      * @param Smarty_Template_Source   $source    source object
 31:      * @param Smarty_Internal_Template $_template template object
 32:      *
 33:      * @throws SmartyException
 34:      */
 35:     public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
 36:     {
 37:         $uid = '';
 38:         $sources = array();
 39:         $components = explode('|', $source->name);
 40:         $exists = true;
 41:         foreach ($components as $component) {
 42:             $s = Smarty_Resource::source(null, $source->smarty, $component);
 43:             if ($s->type == 'php') {
 44:                 throw new SmartyException("Resource type {$s->type} cannot be used with the extends resource type");
 45:             }
 46:             $sources[$s->uid] = $s;
 47:             $uid .= realpath($s->filepath);
 48:             if ($_template && $_template->smarty->compile_check) {
 49:                 $exists = $exists && $s->exists;
 50:             }
 51:         }
 52:         $source->components = $sources;
 53:         $source->filepath = $s->filepath;
 54:         $source->uid = sha1($uid);
 55:         if ($_template && $_template->smarty->compile_check) {
 56:             $source->timestamp = $s->timestamp;
 57:             $source->exists = $exists;
 58:         }
 59:         // need the template at getContent()
 60:         $source->template = $_template;
 61:     }
 62: 
 63:     /**
 64:      * populate Source Object with timestamp and exists from Resource
 65:      *
 66:      * @param Smarty_Template_Source $source source object
 67:      */
 68:     public function populateTimestamp(Smarty_Template_Source $source)
 69:     {
 70:         $source->exists = true;
 71:         foreach ($source->components as $s) {
 72:             $source->exists = $source->exists && $s->exists;
 73:         }
 74:         $source->timestamp = $s->timestamp;
 75:     }
 76: 
 77:     /**
 78:      * Load template's source from files into current template object
 79:      *
 80:      * @param Smarty_Template_Source $source source object
 81:      *
 82:      * @return string template source
 83:      * @throws SmartyException if source cannot be loaded
 84:      */
 85:     public function getContent(Smarty_Template_Source $source)
 86:     {
 87:         if (!$source->exists) {
 88:             throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
 89:         }
 90: 
 91:         $_components = array_reverse($source->components);
 92: 
 93:         $_content = '';
 94:         foreach ($_components as $_component) {
 95:             // read content
 96:             $_content .= $_component->content;
 97:         }
 98:         return $_content;
 99:     }
100: 
101:     /**
102:      * Determine basename for compiled filename
103:      *
104:      * @param Smarty_Template_Source $source source object
105:      *
106:      * @return string resource's basename
107:      */
108:     public function getBasename(Smarty_Template_Source $source)
109:     {
110:         return str_replace(':', '.', basename($source->filepath));
111:     }
112: }
113: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen