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 Special Smarty Variable
  4:  * Compiles the special $smarty variables
  5:  *
  6:  * @package    Smarty
  7:  * @subpackage Compiler
  8:  * @author     Uwe Tews
  9:  */
 10: 
 11: /**
 12:  * Smarty Internal Plugin Compile special Smarty Variable Class
 13:  *
 14:  * @package    Smarty
 15:  * @subpackage Compiler
 16:  */
 17: class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_CompileBase
 18: {
 19:     /**
 20:      * Compiles code for the special $smarty variables
 21:      *
 22:      * @param  array  $args     array with attributes from parser
 23:      * @param  object $compiler compiler object
 24:      * @param         $parameter
 25:      *
 26:      * @return string compiled code
 27:      */
 28:     public function compile($args, $compiler, $parameter)
 29:     {
 30:         $_index = preg_split("/\]\[/", substr($parameter, 1, strlen($parameter) - 2));
 31:         $compiled_ref = ' ';
 32:         $variable = trim($_index[0], "'");
 33:         switch ($variable) {
 34:             case 'foreach':
 35:                 return "\$_smarty_tpl->getVariable('smarty')->value$parameter";
 36:             case 'section':
 37:                 return "\$_smarty_tpl->getVariable('smarty')->value$parameter";
 38:             case 'capture':
 39:                 return "Smarty::\$_smarty_vars$parameter";
 40:             case 'now':
 41:                 return 'time()';
 42:             case 'cookies':
 43:                 if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_super_globals) {
 44:                     $compiler->trigger_template_error("(secure mode) super globals not permitted");
 45:                     break;
 46:                 }
 47:                 $compiled_ref = '$_COOKIE';
 48:                 break;
 49: 
 50:             case 'get':
 51:             case 'post':
 52:             case 'env':
 53:             case 'server':
 54:             case 'session':
 55:             case 'request':
 56:                 if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_super_globals) {
 57:                     $compiler->trigger_template_error("(secure mode) super globals not permitted");
 58:                     break;
 59:                 }
 60:                 $compiled_ref = '$_' . strtoupper($variable);
 61:                 break;
 62: 
 63:             case 'template':
 64:                 return 'basename($_smarty_tpl->source->filepath)';
 65: 
 66:             case 'template_object':
 67:                 return '$_smarty_tpl';
 68: 
 69:             case 'current_dir':
 70:                 return 'dirname($_smarty_tpl->source->filepath)';
 71: 
 72:             case 'version':
 73:                 $_version = Smarty::SMARTY_VERSION;
 74: 
 75:                 return "'$_version'";
 76: 
 77:             case 'const':
 78:                 if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_constants) {
 79:                     $compiler->trigger_template_error("(secure mode) constants not permitted");
 80:                     break;
 81:                 }
 82: 
 83:                 return "@constant({$_index[1]})";
 84: 
 85:             case 'config':
 86:                 if (isset($_index[2])) {
 87:                     return "(is_array(\$tmp = \$_smarty_tpl->getConfigVariable($_index[1])) ? \$tmp[$_index[2]] : null)";
 88:                 } else {
 89:                     return "\$_smarty_tpl->getConfigVariable($_index[1])";
 90:                 }
 91:             case 'ldelim':
 92:                 $_ldelim = $compiler->smarty->left_delimiter;
 93: 
 94:                 return "'$_ldelim'";
 95: 
 96:             case 'rdelim':
 97:                 $_rdelim = $compiler->smarty->right_delimiter;
 98: 
 99:                 return "'$_rdelim'";
100: 
101:             default:
102:                 $compiler->trigger_template_error('$smarty.' . trim($_index[0], "'") . ' is invalid');
103:                 break;
104:         }
105:         if (isset($_index[1])) {
106:             array_shift($_index);
107:             foreach ($_index as $_ind) {
108:                 $compiled_ref = $compiled_ref . "[$_ind]";
109:             }
110:         }
111: 
112:         return $compiled_ref;
113:     }
114: }
115: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen