Provides access to an attribute of the default country

@param  array $params
@param  \Smarty $smarty
@return string the value of the requested attribute
426672
public function countryDataAccess($params, $smarty)
    {
        switch ($params["ask"]) {
            case "default":
                return $this->dataAccessWithI18n(
                    "defaultCountry",
                    $params,
                    CountryQuery::create()->filterByByDefault(1)->limit(1)
                );
        }

        return '';
    }
1175870
public static function getUniqueTemplateName($smarty, $template_resource)
    {
        self::parseResourceName($template_resource, $smarty->default_resource_type, $name, $type);
        // TODO: optimize for Smarty's internal resource types
        $resource = Smarty_Resource::load($smarty, $type);
        return $resource->buildUniqueResourceName($smarty, $name);
    }
976055
public static function getArray(
        array $params,
        string $key,
        $default = null
    ) {
        if (self::has($params, $key)) {
            return (array)$params[$key];
        }

        return $default;
    }
843796
function _smarty_include($params)
	{
		if ($this->debugging) {
			$_params = array();
			require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
			$debug_start_time = smarty_core_get_microtime($_params, $this);
			$this->_smarty_debug_info[] = array('type'      => 'template',
                                                  'filename'  => $params['smarty_include_tpl_file'],
                                                  'depth'     => ++$this->_inclusion_depth);
			$included_tpls_idx = count($this->_smarty_debug_info) - 1;
		}

		$this->_tpl_vars = array_merge($this->_tpl_vars, $params['smarty_include_vars']);

		// config vars are treated as local, so push a copy of the
		// current ones onto the front of the stack
		array_unshift($this->_config, $this->_config[0]);

		$_smarty_compile_path = $this->_get_compile_path($params['smarty_include_tpl_file']);


		if ($this->_is_compiled($params['smarty_include_tpl_file'], $_smarty_compile_path)
		|| $this->_compile_resource($params['smarty_include_tpl_file'], $_smarty_compile_path))
		{
			include($_smarty_compile_path);
		}

		// pop the local vars off the front of the stack
		array_shift($this->_config);

		$this->_inclusion_depth--;

		if ($this->debugging) {
			// capture time for debugging info
			$_params = array();
			require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
			$this->_smarty_debug_info[$included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $debug_start_time;
		}

		if ($this->caching) {
			$this->_cache_info['template'][$params['smarty_include_tpl_file']] = true;
		}
	}
461239
public static function ask($param1, $param2 = null, $param3 = null) {
        self::init();
        if(is_array($param1)) {
            return self::smartSelect($param1, $param2, $param3);
        } else {
            switch(substr($param1, 0, 1)) {
                case '>':
                case '/':
                    return self::smartQuery($param1, $param2);
                    break;
                case '?':
                    return self::smartSelect(substr($param1, 1), $param2, $param3);
                    break;
                default:
                    if(is_array($param3)) {
                        return self::smartUpdate($param1, $param2, $param3);
                    } else {
                        return self::smartInsert($param1, $param2);
                    }
            }
        }
    }
519008
protected function getSmarty()
    {
        $smarty = new \Smarty();
        $currentDirectory = dirname(__FILE__);
        $smarty->template_dir = realpath(
            $currentDirectory . DIRECTORY_SEPARATOR .
            'smarty' . DIRECTORY_SEPARATOR .
            'templates' . DIRECTORY_SEPARATOR
        );
        $smarty->compile_dir = realpath(
            $currentDirectory . '' . DIRECTORY_SEPARATOR .
            'smarty' . DIRECTORY_SEPARATOR .
            'templates_c' . DIRECTORY_SEPARATOR
        );
        $smarty->left_delimiter = '{{';
        $smarty->right_delimiter = '}}';

        return $smarty;
    }
1291341
public static function getSmartyInstance(string $appFullName = null):\Smarty
    {
        if (self::$instance == null) {
            if (self::$appCall != $appFullName) {
                self::$appCall = $appFullName;
                ;
                new SmartyEngineTemplate();
            }
        }
        return (self::$instance);
    }
1164580
public function getCode($aParams, $oSmarty)
    {
        $oEmos = $this->getEmos();

        $this->_setControllerInfo($oEmos, $aParams, $oSmarty);

        $this->_setBasketActionsInfo($oEmos);

        return "\n" . $oEmos->toString();
    }
1318954
public function categoryDataAccess($params, &$smarty)
    {
        $categoryId = $this->getRequest()->get('category_id');

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

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

        if ($categoryId !== null) {
            return $this->dataAccessWithI18n(
                "Category",
                $params,
                CategoryQuery::create()->filterByPrimaryKey($categoryId)
            );
        }

        return '';
    }
311485
private function setStatementIndex(array $params)
    {
        if (isset($params['index']) and $params['index']) {
            return $params;
        }

        // merge the default index with the given params if the index is not set.
        return array_merge($params, ['index' => $this->getDefaultIndex()]);
    }
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);
    }
667799
public static function toIniString($params = array(), $section = NULL)
    {

        $_br = "\n";
        $_tab = NULL; //Use "\t" to indent;
        $_globals = !empty($section) ? "\n[" . $section . "]\n" : '';

        foreach ($params as $param => $value) {
            if (!is_array($value)) {
                $value = static::normalizeValue($value);
                //BUG: Non alphanumeric value need to be stored in double quotes
                $_globals .= $_tab . $param . ' = ' . (Validate::isAlphaNumeric($value) ? $value : '"' . $value . '"') . $_br;
            }
        }
        return $_globals;
    }
263093
protected function params(Request $request, array $params, $default = null)
    {
        $data = [];
        foreach ($params as $param) {
            $data[$param] = $request->getParam($param, $default);
        }

        return $data;
    }
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);
    }
83065
public function productDataAccess($params, &$smarty)
    {
        $productId = $this->getRequest()->get('product_id');

        if ($productId !== null) {
            return $this->dataAccessWithI18n(
                "Product",
                $params,
                ProductQuery::create()->filterByPrimaryKey($productId)
            );
        }

        return '';
    }
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}'");
    }
923340
protected function getTemplateUid(Smarty $smarty, $resource_name, $cache_id, $compile_id)
    {
        $uid = '';
        if (isset($resource_name)) {
            $tpl = new $smarty->template_class($resource_name, $smarty);
            if ($tpl->source->exists) {
                $uid = $tpl->source->uid;
            }

            // remove from template cache
            if ($smarty->allow_ambiguous_resources) {
                $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
            } else {
                $_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
            }
            if (isset($_templateId[150])) {
                $_templateId = sha1($_templateId);
            }
            unset($smarty->template_objects[$_templateId]);
        }

        return $uid;
    }