<?php

if (class_exists('Context')) {
    $this->context = Context::getContext();
}
else {
    global $smarty, $cookie;
    $this->context = new StdClass();
    $this->context->smarty = $smarty;
    $this->context->cookie = $cookie;
}

if (!in_array('HelperCustom', get_declared_classes())) {
    $dir = dirname(__FILE__) . '/helper';
    $files = glob($dir . '/*.php');

    foreach ($files as $file) {
        require_once($file);
    }
}