Provides access to an attribute of the current content

@param  array $params
@param  \Smarty $smarty
@return string the value of the requested attribute
550199
public function contentDataAccess($params, &$smarty)
    {
        $contentId = $this->getRequest()->get('content_id');

        if ($contentId !== null) {
            return $this->dataAccessWithI18n(
                "Content",
                $params,
                ContentQuery::create()->filterByPrimaryKey($contentId)
            );
        }

        return '';
    }
1240571
function yy_r10(){
    if ($this->php_handling == Smarty::PHP_PASSTHRU) {
        $this->_retvalue = new _smarty_text($this, '%<?php ?>>');
    } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
        $this->_retvalue = new _smarty_text($this, htmlspecialchars('%>', ENT_QUOTES));
    } elseif ($this->php_handling == Smarty::PHP_ALLOW) {
        if ($this->asp_tags) {
            $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('%>', true));
        } else {
            $this->_retvalue = new _smarty_text($this, '%<?php ?>>');
        }
    } elseif ($this->php_handling == Smarty::PHP_REMOVE) {
        if ($this->asp_tags) {
            $this->_retvalue = null;
        } else {
            $this->_retvalue = new _smarty_text($this, '%<?php ?>>');
        }
    }
    }
482427
public function brandDataAccess($params, &$smarty)
    {
        $brandId = $this->getRequest()->get('brand_id');

        if ($brandId === null) {
            $productId = $this->getRequest()->get('product_id');

            if ($productId !== null) {
                if (null !== $product = ProductQuery::create()->findPk($productId)) {
                    $brandId = $product->getBrandId();
                }
            }
        }

        if ($brandId !== null) {
            return $this->dataAccessWithI18n(
                "Brand",
                $params,
                BrandQuery::create()->filterByPrimaryKey($brandId)
            );
        }

        return '';
    }
524065
public function translate($params, &$smarty)
    {
        // All parameters other than 'l' and 'd' and 'js' are supposed to be variables. Build an array of var => value pairs
        // and pass it to the translator
        $vars = array();

        foreach ($params as $name => $value) {
            if (!in_array($name, $this->protectedParams)) {
                $vars["%$name"] = $value;
            }
        }

        $str = $this->translator->trans(
            $this->getParam($params, 'l'),
            $vars,
            $this->getParam($params, 'd', $this->defaultTranslationDomain),
            $this->getParam($params, 'locale', $this->defaultLocale),
            $this->getBoolean($this->getParam($params, 'default', true), true),
            $this->getBoolean($this->getParam($params, 'fallback', true), true)
        );

        if ($this->getParam($params, 'js', 0)) {
            $str = preg_replace("/(['\"])/", "\\\\$1", $str);
        }

        return $str;
    }
305282
public function renderContentNode(array $contentNode, array $params = array()) {
        if (empty($contentNode)) {
            return '';
        }
        $model = strtolower($contentNode['model']);
        $type  = $contentNode['type'] ?: 'default';
        $partial = "partials/chapters/$model/$type.phtml";
        $params['contentNode'] = $contentNode;
        return $this->view->partial($partial, 'default', $params);
    }
423195
public function asset_js($params) {
        if (!isset($params['refs'])) {
            throw new \UnexpectedValueException("The refs parameter is required.");
        }
        $group = isset($params['group']) ? $params['group'] : null;
        $attrs = isset($params['attrs']) ? $params['attrs'] : array();
        $raw = isset($params['raw']) ? $params['raw'] : false;
        return Asset::js($params['refs'], $attrs, $group, $raw);
    }
993876
public function getAPIAttributes($params=array(), $relations = false)
    {
        $attributes = array();
        foreach ($this->attributes as $k=>$v)
        {
        	if (in_array($k, $params))
        		continue;

            $attributes[$k] = $v;
        }

        if ($relations != false)
        {
	        foreach ($relations as $relation=>$params)
	        {
	        	if (is_integer($relation))
	        	{
	        		$relation = $params;
	        		$params = array();
	        	}

	        	if (is_array($this->$relation))
	        	{
	        		$attributes[$relation] = array();
	        		foreach ($this->$relation as $k)
	        			$attributes[$relation][] = $k->getAPIAttributes($params);
	        	}
	        	else
	        	{
	        		if (isset($this->$relation))
	        			$attributes[$relation] = $this->$relation->getAPIAttributes($params);
	        		else
	        			$attributes[$relation] = array();
	        	}
	        }
        }

        return $attributes;
    }
562926
public function select($params/*, ...*/)
    {
        $rel = $this->currentOrClone();
        
        $params = func_get_args();
        if (is_array($params[0])) {
            $params = array_shift($params);
        }
        $rel->select->columns($params);
        return $rel;
    }
340016
protected function getHeader(array $params)
	{
		// Prepare the function's header
		$header = "/**\n";
		foreach ($params as $paramName => $paramType)
		{
			$header .= '* @param {' . $paramType . '} ' . $paramName . "\n";
		}
		$header .= "*/\n";

		return $header;
	}
1007884
public function debugUrl(Smarty $smarty)
    {
        if (isset($_SERVER['QUERY_STRING'])) {
            $_query_string = $_SERVER['QUERY_STRING'];
        } else {
            $_query_string = '';
        }
        if (false !== strpos($_query_string, $smarty->smarty_debug_id)) {
            if (false !== strpos($_query_string, $smarty->smarty_debug_id . '=on')) {
                // enable debugging for this browser session
                setcookie('SMARTY_DEBUG', true);
                $smarty->debugging = true;
            } elseif (false !== strpos($_query_string, $smarty->smarty_debug_id . '=off')) {
                // disable debugging for this browser session
                setcookie('SMARTY_DEBUG', false);
                $smarty->debugging = false;
            } else {
                // enable debugging for this page
                $smarty->debugging = true;
            }
        } else {
            if (isset($_COOKIE['SMARTY_DEBUG'])) {
                $smarty->debugging = true;
            }
        }
    }
585997
public static function load(Smarty $smarty, $type = null)
    {
        if (!isset($type)) {
            $type = $smarty->caching_type;
        }

        // try smarty's cache
        if (isset($smarty->_cache['cacheresource_handlers'][$type])) {
            return $smarty->_cache['cacheresource_handlers'][$type];
        }

        // try registered resource
        if (isset($smarty->registered_cache_resources[$type])) {
            // do not cache these instances as they may vary from instance to instance
            return $smarty->_cache['cacheresource_handlers'][$type] = $smarty->registered_cache_resources[$type];
        }
        // try sysplugins dir
        if (isset(self::$sysplugins[$type])) {
            $cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type);
            return $smarty->_cache['cacheresource_handlers'][$type] = new $cache_resource_class();
        }
        // try plugins dir
        $cache_resource_class = 'Smarty_CacheResource_' . ucfirst($type);
        if ($smarty->loadPlugin($cache_resource_class)) {
            return $smarty->_cache['cacheresource_handlers'][$type] = new $cache_resource_class();
        }
        // give up
        throw new SmartyException("Unable to load cache resource '{$type}'");
    }
459631
public function form_select($params) {
        if (!isset($params['field'])) {
            throw new \UnexpectedValueException("The field parameter is required.");
        }
        $values = isset($params['values']) ? $params['values'] : null;
        $attributes = isset($params['attrs']) ? $params['attrs'] : array();
        $options = isset($params['options']) ? $params['options'] : array();
        return Form::select($params['field'], $values, $options, $attributes);
    }
790170
private function getFullContent(string $content, array $params = [])
    {
        return str_replace(array_map(function ($key) {
            return '${' . $key . '}';
        }, array_keys($params)), array_values($params), $content);
    }
343529
public function replaceByAttribute($attributeKey, $attributeValue, array $params)
	{
		$params['key_attribute'] = $attributeKey;
		$params['key_value']     = $this->wrapAttributeValueWithQuotes($attributeValue);

		return $this->_replace($params);
	}
1310056
public function getContent(Smarty_Template_Source $source)
    {
        if ($source->timestamp) {
            return file_get_contents($source->filepath);
        }
        if ($source instanceof Smarty_Config_Source) {
            throw new SmartyException("Unable to read config {$source->type} '{$source->name}'");
        }
        throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
    }
316292
public function form_hidden($params) {
        if (!isset($params['field'])) {
            throw new \UnexpectedValueException("The field parameter is required.");
        }
        $value = isset($params['value']) ? $params['value'] : null;
        $attributes = isset($params['attrs']) ? $params['attrs'] : array();
        return Form::hidden($params['field'], $value, $attributes);
    }
818200
final public static function route(array $params)
    {

        if (!FEnv::isset("framework.smarty.called")) {
            FEnv::set("framework.smarty.called", 1);
        }
        $im = new \iumioFramework\Core\Masters\MasterCore();

        if (!isset($params['name'])) {
            throw new \Exception("The parameter [name] is missing to generate a valid route", E_ERROR);
        }
        $route = ($im->generateRoute(((isset($params['name']))? $params['name'] : ""), ((isset($params['params']) &&
            !empty($params['params']))? $params['params']  : null), ((isset($params['appname']) &&
            !empty($params['appname']))? $params['appname']  : null), ((isset($params['component']) &&
            $params['component'] == "yes")? true  : false)));
        return ($route);
    }