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 Compile Block Plugin
 4:  * Compiles code for the execution of block plugin
 5:  *
 6:  * @package    Smarty
 7:  * @subpackage Compiler
 8:  * @author     Uwe Tews
 9:  */
10: 
11: /**
12:  * Smarty Internal Plugin Compile Block Plugin Class
13:  *
14:  * @package    Smarty
15:  * @subpackage Compiler
16:  */
17: class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_CompileBase
18: {
19:     /**
20:      * Attribute definition: Overwrites base class.
21:      *
22:      * @var array
23:      * @see Smarty_Internal_CompileBase
24:      */
25:     public $optional_attributes = array('_any');
26: 
27:     /**
28:      * Compiles code for the execution of block plugin
29:      *
30:      * @param  array  $args      array with attributes from parser
31:      * @param  object $compiler  compiler object
32:      * @param  array  $parameter array with compilation parameter
33:      * @param  string $tag       name of block plugin
34:      * @param  string $function  PHP function name
35:      *
36:      * @return string compiled code
37:      */
38:     public function compile($args, $compiler, $parameter, $tag, $function)
39:     {
40:         if (!isset($tag[5]) || substr($tag, - 5) != 'close') {
41:             // opening tag of block plugin
42:             // check and get attributes
43:             $_attr = $this->getAttributes($compiler, $args);
44:             if ($_attr['nocache'] === true) {
45:                 $compiler->tag_nocache = true;
46:             }
47:             unset($_attr['nocache']);
48:             // convert attributes into parameter array string
49:             $_paramsArray = array();
50:             foreach ($_attr as $_key => $_value) {
51:                 if (is_int($_key)) {
52:                     $_paramsArray[] = "$_key=>$_value";
53:                 } else {
54:                     $_paramsArray[] = "'$_key'=>$_value";
55:                 }
56:             }
57:             $_params = 'array(' . implode(",", $_paramsArray) . ')';
58: 
59:             $this->openTag($compiler, $tag, array($_params, $compiler->nocache));
60:             // maybe nocache because of nocache variables or nocache plugin
61:             $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
62:             // compile code
63:             $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
64:         } else {
65:             // must endblock be nocache?
66:             if ($compiler->nocache) {
67:                 $compiler->tag_nocache = true;
68:             }
69:             // closing tag of block plugin, restore nocache
70:             list($_params, $compiler->nocache) = $this->closeTag($compiler, substr($tag, 0, - 5));
71:             // This tag does create output
72:             $compiler->has_output = true;
73:             // compile code
74:             if (!isset($parameter['modifier_list'])) {
75:                 $mod_pre = $mod_post = '';
76:             } else {
77:                 $mod_pre = ' ob_start(); ';
78:                 $mod_post = 'echo ' . $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifier_list'], 'value' => 'ob_get_clean()')) . ';';
79:             }
80:             $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;" . $mod_pre . " echo {$function}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . $mod_post . " } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
81:         }
82: 
83:         return $output . "\n";
84:     }
85: }
86: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen