It’s a ternary operator. You can configure your module’s properties depending on the value of Yii::app()->endName property, which is set in the behavior.
Yii::app()->onModuleCreate(new CEvent($this));
Did you already read about events in Yii?
This syntax raises an event “onModuleCreate” (owner is current module, $this), executing all attached handlers. There is the only attached handler “changeModulePaths”. It’s logic is simple: take variable $this and change it’s controllerPath and viewPath properties.