InsertablesAid.php
Go to the documentation of this file.00001 <?php
00017 class InsertablesAid extends TranslationAid {
00018 public function getData() {
00019
00020
00021
00022 $group = $this->handle->getGroup();
00023
00024
00025
00026
00027 if ( !method_exists( $group, 'getInsertablesSuggester' ) ) {
00028 throw new TranslationHelperException( "Group does not have a suggester" );
00029 }
00030
00031 $suggester = $group->getInsertablesSuggester();
00032
00033
00034 if ( !$suggester ) {
00035 throw new TranslationHelperException( "Group does not have a suggester" );
00036 }
00037
00038 $insertables = $suggester->getInsertables( $this->getDefinition() );
00039 $blob = array();
00040 foreach ( $insertables as $insertable ) {
00041 $displayText = $insertable->getDisplayText();
00042
00043
00044 $blob[$displayText] = array(
00045 'display' => $displayText,
00046 'pre' => $insertable->getPreText(),
00047 'post' => $insertable->getPostText(),
00048 );
00049 }
00050
00051 $blob = array_values( $blob );
00052 $blob['**'] = 'insertable';
00053
00054 return $blob;
00055 }
00056 }