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 Function_Call
  4:  * Compiles the calls of user defined tags defined by {function}
  5:  *
  6:  * @package    Smarty
  7:  * @subpackage Compiler
  8:  * @author     Uwe Tews
  9:  */
 10: 
 11: /**
 12:  * Smarty Internal Plugin Compile Function_Call Class
 13:  *
 14:  * @package    Smarty
 15:  * @subpackage Compiler
 16:  */
 17: class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase
 18: {
 19:     /**
 20:      * Attribute definition: Overwrites base class.
 21:      *
 22:      * @var array
 23:      * @see Smarty_Internal_CompileBase
 24:      */
 25:     public $required_attributes = array('name');
 26:     /**
 27:      * Attribute definition: Overwrites base class.
 28:      *
 29:      * @var array
 30:      * @see Smarty_Internal_CompileBase
 31:      */
 32:     public $shorttag_order = array('name');
 33:     /**
 34:      * Attribute definition: Overwrites base class.
 35:      *
 36:      * @var array
 37:      * @see Smarty_Internal_CompileBase
 38:      */
 39:     public $optional_attributes = array('_any');
 40: 
 41:     /**
 42:      * Compiles the calls of user defined tags defined by {function}
 43:      *
 44:      * @param  array  $args     array with attributes from parser
 45:      * @param  object $compiler compiler object
 46:      *
 47:      * @return string compiled code
 48:      */
 49:     public function compile($args, $compiler)
 50:     {
 51:         // check and get attributes
 52:         $_attr = $this->getAttributes($compiler, $args);
 53:         // save possible attributes
 54:         if (isset($_attr['assign'])) {
 55:             // output will be stored in a smarty variable instead of being displayed
 56:             $_assign = $_attr['assign'];
 57:         }
 58:         $_name = $_attr['name'];
 59:         if ($compiler->compiles_template_function) {
 60:             $compiler->called_functions[] = trim($_name, "'\"");
 61:         }
 62:         unset($_attr['name'], $_attr['assign'], $_attr['nocache']);
 63:         // set flag (compiled code of {function} must be included in cache file
 64:         if ($compiler->nocache || $compiler->tag_nocache) {
 65:             $_nocache = 'true';
 66:         } else {
 67:             $_nocache = 'false';
 68:         }
 69:         $_paramsArray = array();
 70:         foreach ($_attr as $_key => $_value) {
 71:             if (is_int($_key)) {
 72:                 $_paramsArray[] = "$_key=>$_value";
 73:             } else {
 74:                 $_paramsArray[] = "'$_key'=>$_value";
 75:             }
 76:         }
 77:         if (isset($compiler->template->properties['function'][$_name]['parameter'])) {
 78:             foreach ($compiler->template->properties['function'][$_name]['parameter'] as $_key => $_value) {
 79:                 if (!isset($_attr[$_key])) {
 80:                     if (is_int($_key)) {
 81:                         $_paramsArray[] = "$_key=>$_value";
 82:                     } else {
 83:                         $_paramsArray[] = "'$_key'=>$_value";
 84:                     }
 85:                 }
 86:             }
 87:         } elseif (isset($compiler->smarty->template_functions[$_name]['parameter'])) {
 88:             foreach ($compiler->smarty->template_functions[$_name]['parameter'] as $_key => $_value) {
 89:                 if (!isset($_attr[$_key])) {
 90:                     if (is_int($_key)) {
 91:                         $_paramsArray[] = "$_key=>$_value";
 92:                     } else {
 93:                         $_paramsArray[] = "'$_key'=>$_value";
 94:                     }
 95:                 }
 96:             }
 97:         }
 98:         //variable name?
 99:         if (!(strpos($_name, '$') === false)) {
100:             $call_cache = $_name;
101:             $call_function = '$tmp = "smarty_template_function_".' . $_name . '; $tmp';
102:         } else {
103:             $_name = trim($_name, "'\"");
104:             $call_cache = "'{$_name}'";
105:             $call_function = 'smarty_template_function_' . $_name;
106:         }
107: 
108:         $_params = 'array(' . implode(",", $_paramsArray) . ')';
109:         $_hash = str_replace('-', '_', $compiler->template->properties['nocache_hash']);
110:         // was there an assign attribute
111:         if (isset($_assign)) {
112:             if ($compiler->template->caching) {
113:                 $_output = "<?php ob_start(); Smarty_Internal_Function_Call_Handler::call ({$call_cache},\$_smarty_tpl,{$_params},'{$_hash}',{$_nocache}); \$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n";
114:             } else {
115:                 $_output = "<?php ob_start(); {$call_function}(\$_smarty_tpl,{$_params}); \$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n";
116:             }
117:         } else {
118:             if ($compiler->template->caching) {
119:                 $_output = "<?php Smarty_Internal_Function_Call_Handler::call ({$call_cache},\$_smarty_tpl,{$_params},'{$_hash}',{$_nocache});?>\n";
120:             } else {
121:                 $_output = "<?php {$call_function}(\$_smarty_tpl,{$_params});?>\n";
122:             }
123:         }
124: 
125:         return $_output;
126:     }
127: }
128: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen