Example #1
0
 /**
  *
  */
 private function loadKeys()
 {
     $locale = refnotes_localization::getInstance();
     foreach ($locale->getByPrefix('dbk') as $key => $text) {
         $this->key[$this->normalizeKeyText($text)] = $key;
     }
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     refnotes_localization::initialize($this);
     $this->mode = substr(get_class($this), 7);
     $this->noteCapture = new refnotes_note_capture();
     $this->initializePatterns();
 }
Example #3
0
 /**
  *
  */
 public static function initialize($plugin)
 {
     if (self::$instance == NULL) {
         self::$instance = new refnotes_localization($plugin);
     }
 }
Example #4
0
 /**
  *
  */
 public function getControl()
 {
     $buttonLabel = refnotes_localization::getInstance()->getLang('opt_inherit');
     $html = '<div class="input">';
     $html .= '<input type="text" class="edit"';
     $html .= ' id="' . $this->id . '"';
     $html .= ' name="' . $this->id . '" />' . DOKU_LF;
     $html .= '<input type="button" class="button"';
     $html .= ' id="' . $this->id . '-inherit"';
     $html .= ' name="' . $this->id . '-inherit"';
     $html .= ' value="' . $buttonLabel . '"';
     $html .= ' />';
     $html .= '</div>';
     return $html;
 }
Example #5
0
 /**
  *
  */
 private function setupReferenceDatabase($namespace)
 {
     $success = true;
     $source = refnotes_localization::getInstance()->getFileName('__template');
     $destination = wikiFN(cleanID($namespace . ':template'));
     $destination = preg_replace('/template.txt$/', '__template.txt', $destination);
     if (@filemtime($destination) < @filemtime($source)) {
         if (!file_exists(dirname($destination))) {
             @mkdir(dirname($destination), 0755, true);
         }
         $success = copy($source, $destination);
         touch($destination, filemtime($source));
     }
     return $success;
 }
Example #6
0
 /**
  *
  */
 protected function renderBook($data, $title)
 {
     $text = '//' . $title . '//';
     if ($chapter = $data->get('chapter')) {
         $text = $chapter . '. ' . refnotes_localization::getInstance()->getLang('txt_in_cap') . ' ' . $text;
     }
     if ($edition = $data->get('edition')) {
         $text .= ' ' . $edition . '.';
     }
     return $text;
 }