コード例 #1
0
ファイル: docs_helper.php プロジェクト: bermi/akelos
 private function _highlightNotes($textile)
 {
     if (preg_match_all('/(IMPORTANT|CAUTION|WARNING|NOTE|INFO|TIP)(?:\\.|\\:)(.*)/', $textile, $matches)) {
         foreach ($matches[1] as $k => $class) {
             $css_class = strtolower($class);
             $css_class = in_array($css_class, array('caution', 'important')) ? 'warning' : $css_class;
             $css_class = in_array($css_class, array('tip')) ? 'info' : $css_class;
             $note_caption = $this->t(ucfirst($css_class));
             $pin_note = "<notextile><p class='{$css_class}-box highlighted-box'> <img height='52' width='27' class='no-print' alt='' src='" . $this->_controller->url_helper->url_for(array('action' => 'images', 'id' => "{$css_class}-pin", 'format' => 'gif', 'controller' => 'virtual_assets')) . "'><strong class='only-print'>{$note_caption}: </strong>" . AkTextHelper::textilize_without_paragraph($this->_replacePlusPlus($matches[2][$k])) . "</p></notextile>";
             // $simple_note = "<notextile><div class='$css_class'><p>".strip_tags($matches[2][$k]).'</p></div></notextile>';
             $textile = str_replace($matches[0][$k], $pin_note, $textile);
         }
     }
     return $textile;
 }