Exemplo n.º 1
0
 /**
  * Takes a string of Japanese text and returns the kanji with links to
  * the Study page, and the title attribute contains the RTK keyword.
  * 
  * @param string $compound 
  * 
  * @return string  Html markup
  */
 public static function getKeywordizedCompound($compound)
 {
     $chars = CJK::splitU($compound);
     //DBG::out(print_r($chars, true));
     $s = '';
     coreToolkit::loadHelpers(array('Tag', 'Url'));
     foreach ($chars as $c) {
         if (false !== ($framenum = rtkBook::getIndexForKanji($c))) {
             $keyword = KanjisPeer::getKeyword($framenum);
             // FIXME - internal uri should be '@study_edit?id=' once it goes to production site..
             $url = link_to($c, 'http://kanji.koohii.com/study/kanji/' . $c, array('title' => $keyword));
             $s = $s . $url;
         } else {
             $s = $s . $c;
         }
     }
     //DBG::out($s);exit;
     return $s;
 }
Exemplo n.º 2
0
 /**
  * Takes a string of Japanese text and returns the kanji with links to
  * the Study page, and the title attribute contains the RTK keyword.
  * 
  * @param string $compound 
  * 
  * @return string  Html markup
  */
 public static function getKeywordizedCompound($compound)
 {
     $chars = CJK::splitU($compound);
     //DBG::out(print_r($chars, true));
     $s = '';
     coreToolkit::loadHelpers(array('Tag', 'Url'));
     foreach ($chars as $c) {
         if (false !== ($framenum = rtkBook::getIndexForKanji($c))) {
             $keyword = KanjisPeer::getKeyword($framenum);
             $url = link_to($c, '@study_edit?id=' . $c, array('title' => $keyword));
             $s = $s . $url;
         } else {
             $s = $s . $c;
         }
     }
     //DBG::out($s);exit;
     return $s;
 }