Skip to content

Commit

Permalink
Allow TextHelper to be overwritten by a package
Browse files Browse the repository at this point in the history
  • Loading branch information
beebs93 committed Mar 5, 2013
1 parent 71fa6e3 commit 748a6d2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions web/concrete/core/libraries/loader.php
Expand Up @@ -183,19 +183,18 @@ public static function autoload($class) {
if ($cl) {
call_user_func_array(array(__CLASS__, $cl[0]), array($cl[1], $cl[2]));
} else {
/* lets handle some things slightly more dynamically */
$txt = self::helper('text');
/* lets handle some things slightly more dynamically */
if (strpos($class, 'BlockController') > 0) {
$class = substr($class, 0, strpos($class, 'BlockController'));
$handle = $txt->uncamelcase($class);
$handle = Object::uncamelcase($class);
self::block($handle);
} else if (strpos($class, 'AttributeType') > 0) {
$class = substr($class, 0, strpos($class, 'AttributeType'));
$handle = $txt->uncamelcase($class);
$handle = Object::uncamelcase($class);
$at = AttributeType::getByHandle($handle);
} else if (strpos($class, 'Helper') > 0) {
$class = substr($class, 0, strpos($class, 'Helper'));
$handle = $txt->uncamelcase($class);
$handle = Object::uncamelcase($class);
$handle = preg_replace('/^site_/', '', $handle);
self::helper($handle);
}
Expand Down

0 comments on commit 748a6d2

Please sign in to comment.