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: /**
 4:  * Smarty Internal Plugin Compile extend
 5:  * Compiles the {extends} tag
 6:  *
 7:  * @package    Smarty
 8:  * @subpackage Compiler
 9:  * @author     Uwe Tews
10:  */
11: 
12: /**
13:  * Smarty Internal Plugin Compile extend Class
14:  *
15:  * @package    Smarty
16:  * @subpackage Compiler
17:  */
18: class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase
19: {
20:     /**
21:      * Attribute definition: Overwrites base class.
22:      *
23:      * @var array
24:      * @see Smarty_Internal_CompileBase
25:      */
26:     public $required_attributes = array('file');
27:     /**
28:      * Attribute definition: Overwrites base class.
29:      *
30:      * @var array
31:      * @see Smarty_Internal_CompileBase
32:      */
33:     public $shorttag_order = array('file');
34: 
35:     /**
36:      * Compiles code for the {extends} tag
37:      *
38:      * @param array  $args     array with attributes from parser
39:      * @param object $compiler compiler object
40:      *
41:      * @return string compiled code
42:      */
43:     public function compile($args, $compiler)
44:     {
45:         // check and get attributes
46:         $_attr = $this->getAttributes($compiler, $args);
47:         if ($_attr['nocache'] === true) {
48:             $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
49:         }
50:         if (strpos($_attr['file'], '$_tmp') !== false) {
51:             $compiler->trigger_template_error('illegal value for file attribute', $compiler->lex->taglineno);
52:         }
53: 
54:         $name = $_attr['file'];
55:         /** @var Smarty_Internal_Template $_smarty_tpl
56:          * used in evaluated code
57:          */
58:         $_smarty_tpl = $compiler->template;
59:         eval("\$tpl_name = $name;");
60:         // create template object
61:         $_template = new $compiler->smarty->template_class($tpl_name, $compiler->smarty, $compiler->template);
62:         // check for recursion
63:         $uid = $_template->source->uid;
64:         if (isset($compiler->extends_uid[$uid])) {
65:             $compiler->trigger_template_error("illegal recursive call of \"$include_file\"", $compiler->lex->line - 1);
66:         }
67:         $compiler->extends_uid[$uid] = true;
68:         if (empty($_template->source->components)) {
69:             array_unshift($compiler->sources, $_template->source);
70:         } else {
71:             foreach ($_template->source->components as $source) {
72:                 array_unshift($compiler->sources, $source);
73:                 $uid = $source->uid;
74:                 if (isset($compiler->extends_uid[$uid])) {
75:                     $compiler->trigger_template_error("illegal recursive call of \"{$source->filepath}\"", $compiler->lex->line - 1);
76:                 }
77:                 $compiler->extends_uid[$uid] = true;
78:             }
79:         }
80:         unset ($_template);
81:         $compiler->inheritance_child = true;
82:         $compiler->lex->yypushstate(Smarty_Internal_Templatelexer::CHILDBODY);
83:         return '';
84:     }
85: }
86: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen