Created
April 5, 2012 15:34
-
-
Save somatonic/2311994 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class UserNameLabel extends WireData implements Module{ | |
public static function getModuleInfo() { | |
return array( | |
'title' => __('UserNameLabel', __FILE__), // Module Title | |
'version' => 100, | |
'summary' => __('Overwrite User Name Label', __FILE__), // Module Summary | |
'autoload' => true | |
); | |
} | |
public function init() { | |
if(strpos($_SERVER['REQUEST_URI'],'/users/') !== FALSE ) | |
$this->addHookAfter("Inputfield::render", $this, "changeLabel"); | |
} | |
public function changeLabel($event){ | |
$inputfield = $event->object; | |
if(!$inputfield instanceof InputfieldName ) return; | |
return $event->object = $inputfield->label = $this->_("Username", __FILE__); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment