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 While
 4:  * Compiles the {while} tag
 5:  *
 6:  * @package    Smarty
 7:  * @subpackage Compiler
 8:  * @author     Uwe Tews
 9:  */
10: 
11: /**
12:  * Smarty Internal Plugin Compile While Class
13:  *
14:  * @package    Smarty
15:  * @subpackage Compiler
16:  */
17: class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase
18: {
19:     /**
20:      * Compiles code for the {while} tag
21:      *
22:      * @param  array  $args      array with attributes from parser
23:      * @param  object $compiler  compiler object
24:      * @param  array  $parameter array with compilation parameter
25:      *
26:      * @return string compiled code
27:      */
28:     public function compile($args, $compiler, $parameter)
29:     {
30:         // check and get attributes
31:         $_attr = $this->getAttributes($compiler, $args);
32:         $this->openTag($compiler, 'while', $compiler->nocache);
33: 
34:         if (!array_key_exists("if condition", $parameter)) {
35:             $compiler->trigger_template_error("missing while condition", $compiler->lex->taglineno);
36:         }
37: 
38:         // maybe nocache because of nocache variables
39:         $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
40:         if (is_array($parameter['if condition'])) {
41:             if ($compiler->nocache) {
42:                 $_nocache = ',true';
43:                 // create nocache var to make it know for further compiling
44:                 if (is_array($parameter['if condition']['var'])) {
45:                     $compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_variable(null, true);
46:                 } else {
47:                     $compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_variable(null, true);
48:                 }
49:             } else {
50:                 $_nocache = '';
51:             }
52:             if (is_array($parameter['if condition']['var'])) {
53:                 $_output = "<?php if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value)) \$_smarty_tpl->createLocalArrayVariable(" . $parameter['if condition']['var']['var'] . "$_nocache);\n";
54:                 $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . $parameter['if condition']['var']['smarty_internal_index'] . " = " . $parameter['if condition']['value'] . ") {?>";
55:             } else {
56:                 $_output = "<?php if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});";
57:                 $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . $parameter['if condition']['value'] . ") {?>";
58:             }
59: 
60:             return $_output;
61:         } else {
62:             return "<?php while ({$parameter['if condition']}) {?>";
63:         }
64:     }
65: }
66: 
67: /**
68:  * Smarty Internal Plugin Compile Whileclose Class
69:  *
70:  * @package    Smarty
71:  * @subpackage Compiler
72:  */
73: class Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase
74: {
75:     /**
76:      * Compiles code for the {/while} tag
77:      *
78:      * @param  array  $args     array with attributes from parser
79:      * @param  object $compiler compiler object
80:      *
81:      * @return string compiled code
82:      */
83:     public function compile($args, $compiler)
84:     {
85:         // must endblock be nocache?
86:         if ($compiler->nocache) {
87:             $compiler->tag_nocache = true;
88:         }
89:         $compiler->nocache = $this->closeTag($compiler, array('while'));
90: 
91:         return "<?php }?>";
92:     }
93: }
94: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen