Lines Matching refs:this

80         $this->setupLocale();
81 $this->currentDate = date("c");
82 $this->infoPlugin = $this->getInfo();
122 $menuText = $this->lang['AdminPageName'];
124 $menuText = $this->infoPlugin['name'];
137 $this->redirectionSource = $_POST[self::FORM_NAME_SOURCE_PAGE];
138 $this->redirectionTarget = $_POST[self::FORM_NAME_TARGET_PAGE];
140 if ($this->redirectionSource == $this->redirectionTarget) {
141 … msg($this->lang['SameSourceAndTargetAndPage'] . ': ' . $this->redirectionSource . '', -1);
148 if (page_exists($this->redirectionSource)) {
153 $title = p_get_first_heading($this->redirectionSource);
155 if (!$title) $title = $this->redirectionSource;
156 …msg($this->lang['SourcePageExist'] . ' : <a href="' . wl($this->redirectionSource) . '">' . hsc($t…
162 if (!page_exists($this->redirectionTarget)) {
164 if ($this->isValidURL($this->redirectionTarget)) {
166 $this->targetResourceType = 'Url';
170 … msg($this->lang['NotInternalOrUrlPage'] . ': ' . $this->redirectionTarget . '', -1);
177 $this->targetResourceType = 'Internal Page';
180 $this->addRedirection($this->redirectionSource, $this->redirectionTarget);
181 msg($this->lang['Saved'], 1);
191 $this->deleteRedirection($redirectionId);
192 msg($this->lang['Deleted'], 1);
197 $this->validateRedirection($redirectionId);
198 msg($this->lang['Validated'], 1);
210 echo $this->locale_xhtml('intro');
213 …ptln('<h2><a name="add_redirection" id="add_redirection">' . $this->lang['AddModifyRedirection'] .…
219 …ptln(' <tr><th>' . $this->lang['Field'] . '</th><th>' . $this->lang['Value'] . '</th> <th>' . $th…
223this->lang['source_page'] . ': </label></td><td><input type="text" id="add_sourcepage" name="' . s…
224this->lang['target_page'] . ': </label></td><td><input type="text" id="add_targetpage" name="' . s…
229 …ptln(' <input type="submit" name="Add" class="button" value="' . $this->lang['btn_addmodify'] .…
237 echo $this->locale_xhtml('add');
242 …ptln('<h2><a name="list_redirection" id="list_redirection">' . $this->lang['ListOfRedirection'] . …
251 ptln(' <th>' . $this->lang['SourcePage'] . '</th>');
252 ptln(' <th>' . $this->lang['TargetPage'] . '</th>');
253 ptln(' <th>' . $this->lang['CreationDate'] . '</th>');
260 foreach ($this->getRedirections() as $key => $row) {
262 if ($this->dataStoreType == self::DATA_STORE_TYPE_SQLITE) {
288 …tpl_link(wl($sourcePageId), $this->truncateString($sourcePageId, 30), 'title="' . $sourcePageId . …
291 …tpl_link(wl($targetPageId), $this->truncateString($targetPageId, 30), 'title="' . hsc($title) . ' …
323 if ($this->dataStoreType == null) {
324 $this->initDataStore();
327 if ($this->dataStoreType == self::DATA_STORE_TYPE_CONF_FILE) {
328 unset($this->pageRedirections[strtolower($sourcePageId)]);
329 $this->savePageRedirections();
332 $res = $this->sqlite->query('delete from redirections where source = ?', $sourcePageId);
334 $this->throwRuntimeException("Something went wrong when deleting the redirections");
350 if ($this->dataStoreType == null) {
351 $this->initDataStore();
354 if ($this->dataStoreType == self::DATA_STORE_TYPE_CONF_FILE) {
356 if (isset($this->pageRedirections[$sourcePageId])) {
364 $res = $this->sqlite->query("SELECT * FROM redirections");
365 $count = $this->sqlite->res2count($res);
378 $this->addRedirectionWithDate($sourcePageId, $targetPageId, $this->currentDate);
395 if ($this->dataStoreType == null) {
396 $this->initDataStore();
399 if ($this->dataStoreType == self::DATA_STORE_TYPE_CONF_FILE) {
401 if (isset($this->pageRedirections[$sourcePageId])) {
402 … $this->throwRuntimeException('Redirection for page (' . $sourcePageId . 'already exist');
405 $this->pageRedirections[$sourcePageId]['TargetPage'] = $targetPageId;
406 $this->pageRedirections[$sourcePageId]['CreationDate'] = $creationDate;
410 $this->pageRedirections[$sourcePageId]['IsValidate'] = 'Y';
411 $this->pageRedirections[$sourcePageId]['CountOfRedirection'] = 0;
412 … $this->pageRedirections[$sourcePageId]['LastRedirectionDate'] = $this->lang['Never'];
413 $this->pageRedirections[$sourcePageId]['LastReferrer'] = 'Never';
417 $this->pageRedirections[$sourcePageId]['IsValidate'] = 'N';
418 $this->pageRedirections[$sourcePageId]['CountOfRedirection'] = 1;
419 $this->pageRedirections[$sourcePageId]['LastRedirectionDate'] = $creationDate;
421 … $this->pageRedirections[$sourcePageId]['LastReferrer'] = $_SERVER['HTTP_REFERER'];
423 … $this->pageRedirections[$sourcePageId]['LastReferrer'] = $this->lang['Direct Access'];
428 if (!$this->isValidURL($targetPageId)) {
429 $this->pageRedirections[$sourcePageId]['TargetPageType'] = 'Internal Page';
431 $this->pageRedirections[$sourcePageId]['TargetPageType'] = 'Url';
434 $this->savePageRedirections();
447 $res = $this->sqlite->query($statement, $sourcePageId);
448 $count = $this->sqlite->res2count($res);
450 $res = $this->sqlite->storeEntry('redirections', $entry);
452 $this->throwRuntimeException("There was a problem during insertion");
457 $res = $this->sqlite->query($statement, $entry);
459 $this->throwRuntimeException("There was a problem during the update");
474 if ($this->dataStoreType == null) {
475 $this->initDataStore();
478 if ($this->dataStoreType == self::DATA_STORE_TYPE_CONF_FILE) {
480 $this->pageRedirections[$sourcePageId]['IsValidate'] = 'Y';
481 $this->savePageRedirections();
484 $this->throwRuntimeException('Not implemented for a SQLite data store');
498 if ($this->dataStoreType == null) {
499 $this->initDataStore();
502 if ($this->dataStoreType == self::DATA_STORE_TYPE_CONF_FILE) {
504 if ($this->pageRedirections[$sourcePageId]['IsValidate'] == null) {
507 return $this->pageRedirections[$sourcePageId]['IsValidate'];
511 $this->throwRuntimeException("Not Yet implemented");
524 if ($this->dataStoreType == null) {
525 $this->initDataStore();
528 if ($this->dataStoreType == self::DATA_STORE_TYPE_CONF_FILE) {
531 return $this->pageRedirections[$sourcePageId]['TargetPageType'];
550 if ($this->dataStoreType == null) {
551 $this->initDataStore();
554 if ($this->dataStoreType == self::DATA_STORE_TYPE_CONF_FILE) {
557 return $this->pageRedirections[strtolower($sourcePageId)]['TargetPage'];
561 … $res = $this->sqlite->query("select target from redirections where source = ?", $sourcePageId);
565 $value = $this->sqlite->res2single($res);
582 if ($this->dataStoreType == null) {
583 $this->initDataStore();
586 if ($this->dataStoreType == self::DATA_STORE_TYPE_CONF_FILE) {
589 $this->pageRedirections[$sourcePageId]['LastRedirectionDate'] = $this->currentDate;
590 $this->pageRedirections[$sourcePageId]['LastReferrer'] = $_SERVER['HTTP_REFERER'];
592 $this->pageRedirections[$sourcePageId]['CountOfRedirection'] += 1;
593 $this->savePageRedirections();
598 "TIMESTAMP" => $this->currentDate,
604 $res = $this->sqlite->storeEntry('redirections_log', $row);
621 if ($this->dataStoreType == null) {
622 $this->initDataStore();
625 if ($this->dataStoreType == self::DATA_STORE_TYPE_CONF_FILE) {
627 io_saveFile(self::DATA_STORE_CONF_FILE_PATH, serialize($this->pageRedirections));
631 … $this->throwRuntimeException('SavePageRedirections must no be called for a SQLite data store');
677 $this->dataStoreType = $dataStoreType;
678 $this->initDataStore();
679 return $this;
688 if ($this->dataStoreType == null) {
689 $this->sqlite = plugin_load('helper', 'sqlite');
690 if (!$this->sqlite) {
691 $this->dataStoreType = self::DATA_STORE_TYPE_CONF_FILE;
693 $this->dataStoreType = self::DATA_STORE_TYPE_SQLITE;
697 if ($this->getDataStoreType() == self::DATA_STORE_TYPE_CONF_FILE) {
699 msg($this->getLang('SqliteMandatory'), MANAGER404_MSG_INFO, $allow = MSG_MANAGERS_ONLY);
703 … $this->pageRedirections = unserialize(io_readFile(self::DATA_STORE_CONF_FILE_PATH, false));
709 $pluginName = $this->infoPlugin['base'];
710 if ($this->sqlite == null) {
711 $this->sqlite = plugin_load('helper', 'sqlite');
712 if (!$this->sqlite) {
713 $this->throwRuntimeException("Unable to load the sqlite plugin");
716 $init = $this->sqlite->init($pluginName, DOKU_PLUGIN . $pluginName . '/db/');
718 msg($this->lang['SqliteUnableToInitialize'], MSG_MANAGERS_ONLY);
724 $this->dataStoreMigration();
738 if ($this->dataStoreType == null) {
739 $this->initDataStore();
742 if ($this->dataStoreType == self::DATA_STORE_TYPE_SQLITE) {
744 $res = $this->sqlite->query("delete from redirections");
746 $this->throwRuntimeException('Errors during delete of all redirections');
754 … $this->throwRuntimeException('Unable to delete the file ' . self::DATA_STORE_TYPE_CONF_FILE);
757 $this->pageRedirections = array();
768 if ($this->dataStoreType == null) {
769 $this->initDataStore();
772 if ($this->dataStoreType == self::DATA_STORE_TYPE_SQLITE) {
774 $res = $this->sqlite->query("select count(1) from redirections");
778 $value = $this->sqlite->res2single($res);
783 return count($this->pageRedirections);
790 if ($this->dataStoreType == null) {
791 $this->initDataStore();
793 return $this->dataStoreType;
801 if ($this->dataStoreType == null) {
802 $this->initDataStore();
805 if ($this->dataStoreType == self::DATA_STORE_TYPE_SQLITE) {
807 $res = $this->sqlite->query("select * from redirections");
811 $row = $this->sqlite->res2arr($res);
816 return $this->pageRedirections;
831 throw new RuntimeException($this->getPluginName() . ' - ' . $message);
840 …$this->throwRuntimeException("The file to migrate does not exist (" . self::DATA_STORE_CONF_FILE_P…
854 $this->addRedirectionWithDate($sourcePageId, $targetPageId, $creationDate);