Skip to content

Instantly share code, notes, and snippets.

@somatonic
Created April 5, 2012 15:34
Show Gist options
  • Save somatonic/2311994 to your computer and use it in GitHub Desktop.
Save somatonic/2311994 to your computer and use it in GitHub Desktop.
<?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