Exemplo n.º 1
0
<?php

/*
* @package		Miwi Framework
* @copyright	Copyright (C) 2009-2014 Miwisoft, LLC. All rights reserved.
* @copyright	Copyright (C) 2005-2012 Open Source Matters, Inc. All rights reserved.
* @license		GNU General Public License version 2 or later
*/
defined('MIWI') or die('MIWI');
MHtml::addIncludePath(MPATH_PLATFORM . '/framework/html/html');
mimport('framework.environment.uri');
mimport('framework.environment.browser');
mimport('framework.filesystem.file');
class MHtml
{
    public static $formatOptions = array('format.depth' => 0, 'format.eol' => "\n", 'format.indent' => "\t");
    protected static $includePaths = array();
    protected static $registry = array();
    protected static function extract($key)
    {
        $key = preg_replace('#[^A-Z0-9_\\.]#i', '', $key);
        // Check to see whether we need to load a helper file
        $parts = explode('.', $key);
        $prefix = count($parts) == 3 ? array_shift($parts) : 'MHtml';
        $file = count($parts) == 2 ? array_shift($parts) : '';
        $func = array_shift($parts);
        return array(strtolower($prefix . '.' . $file . '.' . $func), $prefix, $file, $func);
    }
    public static function _($key)
    {
        list($key, $prefix, $file, $func) = self::extract($key);