/** * */ 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(); }
/** * */ public static function initialize($plugin) { if (self::$instance == NULL) { self::$instance = new refnotes_localization($plugin); } }
/** * */ 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; }
/** * */ 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; }
/** * */ 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; }