From: <var...@us...> - 2009-02-14 14:57:06
|
Revision: 6498 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6498&view=rev Author: vargenau Date: 2009-02-14 14:57:03 +0000 (Sat, 14 Feb 2009) Log Message: ----------- Fix regression: lock/unlock checkbox no longer worked if ENABLE_PAGE_PUBLIC was false Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2009-02-13 16:20:08 UTC (rev 6497) +++ trunk/lib/editpage.php 2009-02-14 14:57:03 UTC (rev 6498) @@ -234,16 +234,20 @@ function updateLock() { $changed = false; - if (!ENABLE_PAGE_PUBLIC) { - if ((bool)$this->page->get('locked') == (bool)$this->locked) - return false; // Not changed. - } - if (!$this->user->isAdmin()) { // FIXME: some sort of message return false; // not allowed. } + if ((bool)$this->page->get('locked') != (bool)$this->locked) { + $this->page->set('locked', (bool)$this->locked); + $this->tokens['LOCK_CHANGED_MSG'] + .= $this->locked + ? _("Page now locked.") + : _("Page now unlocked."); + $changed = true; + } + if (ENABLE_PAGE_PUBLIC) { if ((bool)$this->page->get('public') != (bool)$this->public) { $this->page->set('public', (bool)$this->public); @@ -253,13 +257,6 @@ : _("Page now not-public.")) . " "; $changed = true; } - - $this->page->set('locked', (bool)$this->locked); - $this->tokens['LOCK_CHANGED_MSG'] - .= $this->locked - ? _("Page now locked.") - : _("Page now unlocked."); - $changed = true; } return $changed; // lock changed. } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-02-16 09:38:54
|
Revision: 6501 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6501&view=rev Author: vargenau Date: 2009-02-16 09:38:48 +0000 (Mon, 16 Feb 2009) Log Message: ----------- Initialize LOCK_CHANGED_MSG Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2009-02-14 16:39:01 UTC (rev 6500) +++ trunk/lib/editpage.php 2009-02-16 09:38:48 UTC (rev 6501) @@ -75,6 +75,7 @@ $saveFailed = false; $tokens = &$this->tokens; $tokens['PAGE_LOCKED_MESSAGE'] = ''; + $tokens['LOCK_CHANGED_MSG'] = ''; $tokens['CONCURRENT_UPDATE_MESSAGE'] = ''; $r =& $this->request; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-03-25 11:43:43
|
Revision: 6706 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6706&view=rev Author: rurban Date: 2009-03-25 11:43:36 +0000 (Wed, 25 Mar 2009) Log Message: ----------- keep old NS4 virtual hack. fix locked logic Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2009-03-25 11:36:56 UTC (rev 6705) +++ trunk/lib/editpage.php 2009-03-25 11:43:36 UTC (rev 6706) @@ -235,29 +235,30 @@ function updateLock() { $changed = false; + if (!ENABLE_PAGE_PUBLIC) { + if ((bool)$this->page->get('locked') == (bool)$this->locked) + return false; // Not changed. + } + if (!$this->user->isAdmin()) { // FIXME: some sort of message return false; // not allowed. } - if ((bool)$this->page->get('locked') != (bool)$this->locked) { $this->page->set('locked', (bool)$this->locked); $this->tokens['LOCK_CHANGED_MSG'] - .= $this->locked - ? _("Page now locked.") - : _("Page now unlocked."); + .= ($this->locked + ? _("Page now locked.") + : _("Page now unlocked.") . " "); $changed = true; } - - if (ENABLE_PAGE_PUBLIC) { - if ((bool)$this->page->get('public') != (bool)$this->public) { - $this->page->set('public', (bool)$this->public); - $this->tokens['LOCK_CHANGED_MSG'] - = ($this->public - ? _("Page now public.") - : _("Page now not-public.")) . " "; - $changed = true; - } + if (ENABLE_PAGE_PUBLIC and (bool)$this->page->get('public') != (bool)$this->public) { + $this->page->set('public', (bool)$this->public); + $this->tokens['LOCK_CHANGED_MSG'] + .= ($this->public + ? _("Page now public.") + : _("Page now not-public.")); + $changed = true; } return $changed; // lock changed. } @@ -514,7 +515,7 @@ ']')); } else { - // New CSS formatted unified diffs + // New CSS formatted unified diffs (ugly in NS4). $fmt = new HtmlUnifiedDiffFormatter; // Use this for old table-formatted diffs. //$fmt = new TableUnifiedDiffFormatter; @@ -611,6 +612,11 @@ 'cols' => $request->getPref('editWidth'), 'readonly' => (bool) $readonly), $this->_content); + /** <textarea wrap="virtual"> is not valid XHTML but Netscape 4 requires it + * to wrap long lines. + */ + if (isBrowserNS4()) + $textarea->setAttr('wrap', 'virtual'); if (ENABLE_WYSIWYG) { return $this->WysiwygEdit->Textarea($textarea, $this->_wikicontent, $textarea->getAttr('name')); @@ -660,9 +666,8 @@ = HTML::input(array('type' => 'checkbox', 'name' => 'edit[locked]', 'id' => 'edit-locked', - 'disabled' => (bool) !$this->user->isadmin(), + 'disabled' => (bool) !$this->user->isAdmin(), 'checked' => (bool) $this->locked)); - if (ENABLE_PAGE_PUBLIC) { $el['PUBLIC_CB'] = HTML::input(array('type' => 'checkbox', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-03-05 08:49:48
|
Revision: 8244 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8244&view=rev Author: vargenau Date: 2012-03-05 08:49:38 +0000 (Mon, 05 Mar 2012) Log Message: ----------- Avoid warning for function getConflictMessage Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2012-03-01 11:58:38 UTC (rev 8243) +++ trunk/lib/editpage.php 2012-03-05 08:49:38 UTC (rev 8244) @@ -941,7 +941,7 @@ return true; } - function getConflictMessage () { + function getConflictMessage ($unresolved = false) { $message = HTML(HTML::p(fmt("Some of the changes could not automatically be combined. Please look for sections beginning with '%s', and ending with '%s'. You will need to edit those sections by hand before you click Save.", "<<<<<<<", "======="), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-02-15 15:14:54
|
Revision: 8728 http://sourceforge.net/p/phpwiki/code/8728 Author: vargenau Date: 2013-02-15 15:14:50 +0000 (Fri, 15 Feb 2013) Log Message: ----------- Add class warning_msg; remove brackets Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2013-02-06 10:04:48 UTC (rev 8727) +++ trunk/lib/editpage.php 2013-02-15 15:14:50 UTC (rev 8728) @@ -523,8 +523,8 @@ $diff = new Diff($this->current->getContent(), explode("\n", $this->getContent())); if ($diff->isEmpty()) { $html->pushContent(HTML::hr(), - HTML::p('[', _("Versions are identical"), - ']')); + HTML::p(array('class' => 'warning_msg'), + _("Versions are identical"))); } else { // New CSS formatted unified diffs $fmt = new HtmlUnifiedDiffFormatter; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-04-10 07:39:37
|
Revision: 8746 http://sourceforge.net/p/phpwiki/code/8746 Author: vargenau Date: 2013-04-10 07:39:34 +0000 (Wed, 10 Apr 2013) Log Message: ----------- Avoid PHP warning: Undefined variable: EDIT_TOOLBAR, /opt/acosforge-trunk/src/plugins/wiki/www/lib/Template.php when ENABLE_EDIT_TOOLBAR is false Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2013-04-08 14:23:40 UTC (rev 8745) +++ trunk/lib/editpage.php 2013-04-10 07:39:34 UTC (rev 8746) @@ -180,6 +180,8 @@ require_once 'lib/EditToolbar.php'; $toolbar = new EditToolbar(); $tokens = array_merge($tokens, $toolbar->getTokens()); + } else { + $tokens['EDIT_TOOLBAR'] = ''; } return $this->output('editpage', _("Edit: %s")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-29 12:59:45
|
Revision: 9132 http://sourceforge.net/p/phpwiki/code/9132 Author: vargenau Date: 2014-09-29 12:59:42 +0000 (Mon, 29 Sep 2014) Log Message: ----------- Define explicitely class variables Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2014-09-29 12:58:35 UTC (rev 9131) +++ trunk/lib/editpage.php 2014-09-29 12:59:42 UTC (rev 9132) @@ -1,9 +1,34 @@ <?php require_once 'lib/Template.php'; +require_once 'lib/WikiUser.php'; class PageEditor { - function PageEditor(&$request) + public $request; + public $user; + public $page; + /** + * @var WikiDB_PageRevision + */ + public $current; + public $editaction; + public $locked; + public $public; + public $external; + + protected $_currentVersion; + + /** + * @var UserPreferences + */ + private $_prefs; + private $_isSpam; + private $_wikicontent; + + /** + * @param WikiRequest $request + */ + function __construct(&$request) { $this->request = &$request; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-29 15:22:41
|
Revision: 9133 http://sourceforge.net/p/phpwiki/code/9133 Author: vargenau Date: 2014-09-29 15:22:36 +0000 (Mon, 29 Sep 2014) Log Message: ----------- Add global $request; $_currentVersion is public Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2014-09-29 12:59:42 UTC (rev 9132) +++ trunk/lib/editpage.php 2014-09-29 15:22:36 UTC (rev 9133) @@ -4,24 +4,23 @@ class PageEditor { - public $request; - public $user; - public $page; - /** - * @var WikiDB_PageRevision - */ - public $current; - public $editaction; - public $locked; - public $public; - public $external; + public $request; + public $user; + public $page; + /** + * @var WikiDB_PageRevision + */ + public $current; + public $editaction; + public $locked; + public $public; + public $external; + public $_currentVersion; - protected $_currentVersion; - - /** - * @var UserPreferences - */ - private $_prefs; + /** + * @var UserPreferences + */ + private $_prefs; private $_isSpam; private $_wikicontent; @@ -125,6 +124,7 @@ HTML::p(HTML::h1($this->Captcha->failed_msg)); } elseif ($this->savePage()) { // noreturn + global $request; $request->setArg('action', false); $r->redirect(WikiURL($r->getArg('save_and_redirect_to'))); return true; // Page saved. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-12-09 10:56:27
|
Revision: 9437 http://sourceforge.net/p/phpwiki/code/9437 Author: vargenau Date: 2014-12-09 10:56:24 +0000 (Tue, 09 Dec 2014) Log Message: ----------- Add public/protected/private Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2014-12-08 17:29:32 UTC (rev 9436) +++ trunk/lib/editpage.php 2014-12-09 10:56:24 UTC (rev 9437) @@ -91,7 +91,7 @@ header("Content-Type: text/html; charset=UTF-8"); } - function editPage() + public function editPage() { $saveFailed = false; $tokens = &$this->tokens; @@ -156,7 +156,7 @@ return true; } elseif ($this->editaction == 'upload') { // run plugin UpLoad - $plugin = WikiPluginLoader("UpLoad"); + $plugin = new WikiPluginLoader("UpLoad"); $plugin->run(); // add link to content ; @@ -210,7 +210,7 @@ return $this->output('editpage', _("Edit: %s")); } - function output($template, $title_fs) + public function output($template, $title_fs) { global $WikiTheme; $selected = &$this->selected; @@ -238,7 +238,7 @@ return true; } - function viewSource() + public function viewSource() { assert($this->isInitialEdit()); assert($this->selected); @@ -248,7 +248,7 @@ return $this->output('viewsource', _("View Source: %s")); } - function updateLock() + private function updateLock() { $changed = false; if (!ENABLE_PAGE_PUBLIC && !ENABLE_EXTERNAL_PAGES) { @@ -290,7 +290,7 @@ return $changed; // lock changed. } - function savePage() + public function savePage() { $request = &$this->request; @@ -379,23 +379,23 @@ return true; } - function isConcurrentUpdate() + protected function isConcurrentUpdate() { assert($this->current->getVersion() >= $this->_currentVersion); return $this->current->getVersion() != $this->_currentVersion; } - function canEdit() + protected function canEdit() { return !$this->page->get('locked') || $this->user->isAdmin(); } - function isInitialEdit() + protected function isInitialEdit() { return $this->_initialEdit; } - function isUnchanged() + private function isUnchanged() { $current = &$this->current; return $this->_content == $current->getPackedContent(); @@ -411,7 +411,7 @@ * ENABLE_SPAMASSASSIN: content patterns by babycart (only php >= 4.3 for now) * ENABLE_SPAMBLOCKLIST: content domain blacklist */ - function isSpam() + private function isSpam() { $current = &$this->current; $request = &$this->request; @@ -487,14 +487,14 @@ /** Number of external links in the wikitext */ - function numLinks(&$text) + private function numLinks(&$text) { return substr_count($text, "http://") + substr_count($text, "https://"); } /** Header of the Anti Spam message */ - function getSpamMessage() + private function getSpamMessage() { return HTML(HTML::h2(_("Spam Prevention")), @@ -504,21 +504,21 @@ HTML::p("")); } - function getPreview() + protected function getPreview() { require_once 'lib/PageType.php'; $this->_content = $this->getContent(); return new TransformedText($this->page, $this->_content, $this->meta); } - function getConvertedPreview() + protected function getConvertedPreview() { require_once 'lib/PageType.php'; $this->_content = $this->getContent(); return new TransformedText($this->page, $this->_content, $this->meta); } - function getDiff() + private function getDiff() { require_once 'lib/diff.php'; $html = HTML(); @@ -537,7 +537,7 @@ } // possibly convert HTMLAREA content back to Wiki markup - function getContent() + private function getContent() { if (ENABLE_WYSIWYG) { // don't store everything as html @@ -555,7 +555,7 @@ } } - function getLockedMessage() + protected function getLockedMessage() { return HTML(HTML::h2(_("Page Locked")), @@ -564,12 +564,12 @@ HTML::p(_("Sorry for the inconvenience."))); } - function isModerated() + private function isModerated() { return $this->page->get('moderation'); } - function getModeratedMessage() + private function getModeratedMessage() { return HTML(HTML::h2(WikiLink(_("ModeratedPage"))), @@ -578,7 +578,7 @@ WikiLink(_("UserPreferences"))))); } - function getConflictMessage($unresolved = false) + protected function getConflictMessage($unresolved = false) { /* xgettext only knows about c/c++ line-continuation strings @@ -608,7 +608,7 @@ $message); } - function getTextArea() + private function getTextArea() { $request = &$this->request; @@ -636,7 +636,7 @@ return $textarea; } - function getFormElements() + protected function getFormElements() { global $WikiTheme; $request = &$this->request; @@ -746,7 +746,7 @@ $this->request->redirect(WikiURL($this->page, array(), 'absolute_url')); } - function _restoreState() + private function _restoreState() { $request = &$this->request; @@ -797,7 +797,7 @@ return true; } - function _initializeState() + private function _initializeState() { $request = &$this->request; $current = &$this->current; @@ -830,7 +830,7 @@ class LoadFileConflictPageEditor extends PageEditor { - function editPage($saveFailed = true) + public function editPage($saveFailed = true) { $tokens = &$this->tokens; @@ -905,7 +905,7 @@ return $this->output('editpage', _("Merge and Edit: %s")); } - function output($template, $title_fs) + public function output($template, $title_fs) { $selected = &$this->selected; $current = &$this->current; @@ -931,7 +931,7 @@ return true; } - function getConflictMessage($unresolved = false) + protected function getConflictMessage($unresolved = false) { $message = HTML(HTML::p(fmt("Some of the changes could not automatically be combined. Please look for sections beginning with “%s”, and ending with “%s”. You will need to edit those sections by hand before you click Save.", "<<<<<<<", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-04-10 15:01:05
|
Revision: 9654 http://sourceforge.net/p/phpwiki/code/9654 Author: vargenau Date: 2015-04-10 15:01:02 +0000 (Fri, 10 Apr 2015) Log Message: ----------- Translate strings Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2015-04-10 14:34:25 UTC (rev 9653) +++ trunk/lib/editpage.php 2015-04-10 15:01:02 UTC (rev 9654) @@ -683,42 +683,42 @@ 'class' => 'toolbar', 'alt' => _('Bold text'), 'title' => _('Bold text'), - 'onclick' => "insertTags('**','**','Bold text'); return true;"))); + 'onclick' => "insertTags('**','**','"._('Bold text')."'); return true;"))); $toolbar->pushContent(HTML::img(array('src' => $WikiTheme->getImageURL("ed_format_italic.png"), 'class' => 'toolbar', 'alt' => _('Italic text'), 'title' => _('Italic text'), - 'onclick' => "insertTags('//','//','Italic text'); return true;"))); + 'onclick' => "insertTags('//','//','"._('Italic text')."'); return true;"))); $toolbar->pushContent(HTML::img(array('src' => $WikiTheme->getImageURL("ed_format_strike.png"), 'class' => 'toolbar', 'alt' => _('Strike-through text'), 'title' => _('Strike-through text'), - 'onclick' => "insertTags('<s>','</s>','Strike-through text'); return true;"))); + 'onclick' => "insertTags('<s>','</s>','"._('Strike-through text')."'); return true;"))); $toolbar->pushContent(HTML::img(array('src' => $WikiTheme->getImageURL("ed_format_color.png"), 'class' => 'toolbar', 'alt' => _('Color text'), 'title' => _('Color text'), - 'onclick' => "insertTags('%color=green%','%%','Color text'); return true;"))); + 'onclick' => "insertTags('%color=green%','%%','"._('Color text')."'); return true;"))); $toolbar->pushContent(HTML::img(array('src' => $WikiTheme->getImageURL("ed_pagelink.png"), 'class' => 'toolbar', 'alt' => _('Link to page'), 'title' => _('Link to page'), - 'onclick' => "insertTags('[[',']]','PageName|optional label'); return true;"))); + 'onclick' => "insertTags('[[',']]','"._('PageName|optional label')."'); return true;"))); $toolbar->pushContent(HTML::img(array('src' => $WikiTheme->getImageURL("ed_link.png"), 'class' => 'toolbar', 'alt' => _('External link (remember http:// prefix)'), 'title' => _('External link (remember http:// prefix)'), - 'onclick' => "insertTags('[[',']]','http://www.example.com|optional label'); return true;"))); + 'onclick' => "insertTags('[[',']]','"._('http://www.example.com|optional label')."'); return true;"))); $toolbar->pushContent(HTML::img(array('src' => $WikiTheme->getImageURL("ed_headline.png"), 'class' => 'toolbar', 'alt' => _('Level 1 headline'), 'title' => _('Level 1 headline'), - 'onclick' => 'insertTags("\n==","==\n","Headline text"); return true;'))); + 'onclick' => 'insertTags("\n== "," ==\n","'._("Headline text").'"); return true;'))); $toolbar->pushContent(HTML::img(array('src' => $WikiTheme->getImageURL("ed_nowiki.png"), 'class' => 'toolbar', 'alt' => _('Ignore wiki formatting'), 'title' => _('Ignore wiki formatting'), - 'onclick' => 'insertTags("<verbatim>\n","\n</verbatim>","Insert non-formatted text here"); return true;'))); + 'onclick' => 'insertTags("<verbatim>\n","\n</verbatim>","'._("Insert non-formatted text here").'"); return true;'))); global $request; $username = $request->_user->UserName(); $signature = " ––[[" . $username . "]] " . CTime() . '\n'; @@ -756,12 +756,13 @@ 'class' => 'toolbar', 'alt' => _('Redirect'), 'title' => _('Redirect'), - 'onclick' => "insertTags('<<RedirectTo page="','">>','Page Name'); return true;"))); + 'onclick' => "insertTags('<<RedirectTo page="','">>','"._('Page Name')."'); return true;"))); $toolbar->pushContent(HTML::img(array('src' => $WikiTheme->getImageURL("ed_templateplugin.png"), 'class' => 'toolbar', 'alt' => _('Template'), 'title' => _('Template'), - 'onclick' => "insertTags('{{','}}','Template Name'); return true;"))); + 'onclick' => "insertTags('{{','}}','"._('Template Name')."'); return true;"))); + $toolbar->pushContent($this->categoriesPulldown()); $toolbar->pushContent($this->pluginPulldown()); if (defined('TOOLBAR_PAGELINK_PULLDOWN') and TOOLBAR_PAGELINK_PULLDOWN) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-04-10 15:35:12
|
Revision: 9656 http://sourceforge.net/p/phpwiki/code/9656 Author: vargenau Date: 2015-04-10 15:35:00 +0000 (Fri, 10 Apr 2015) Log Message: ----------- Remove WIDTH_PREF and HEIGHT_PREF Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2015-04-10 15:05:23 UTC (rev 9655) +++ trunk/lib/editpage.php 2015-04-10 15:35:00 UTC (rev 9656) @@ -1031,13 +1031,10 @@ $el['WYSIWYG_B'] = Button(array("action" => "edit", "mode" => "wysiwyg"), "Wysiwyg Editor"); } } - $el['PREVIEW_B'] = Button('submit:edit[preview]', _("Preview"), 'wikiaction', array('accesskey' => 'p', 'title' => _('Preview the current content [alt-p]'))); - - //if (!$this->isConcurrentUpdate() && $this->canEdit()) $el['SAVE_B'] = Button('submit:edit[save]', _("Save"), 'wikiaction', array('accesskey' => 's', @@ -1053,25 +1050,6 @@ _("Spell Check"), 'wikiaction', array('title' => _('Check the spelling'))); $el['IS_CURRENT'] = $this->version == $this->current->getVersion(); - - $el['WIDTH_PREF'] - = HTML::input(array('type' => 'text', - 'size' => 3, - 'maxlength' => 4, - 'class' => "numeric", - 'name' => 'pref[editWidth]', - 'id' => 'pref-editWidth', - 'value' => $request->getPref('editWidth'), - 'onchange' => 'this.form.submit();')); - $el['HEIGHT_PREF'] - = HTML::input(array('type' => 'text', - 'size' => 3, - 'maxlength' => 4, - 'class' => "numeric", - 'name' => 'pref[editHeight]', - 'id' => 'pref-editHeight', - 'value' => $request->getPref('editHeight'), - 'onchange' => 'this.form.submit();')); $el['SEP'] = $WikiTheme->getButtonSeparator(); $el['AUTHOR_MESSAGE'] = fmt("Author will be logged as %s.", HTML::em($this->user->getId())); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-04-14 16:31:07
|
Revision: 9668 http://sourceforge.net/p/phpwiki/code/9668 Author: vargenau Date: 2015-04-14 16:31:05 +0000 (Tue, 14 Apr 2015) Log Message: ----------- Display Search&Replace icons only if JS_SEARCHREPLACE is true Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2015-04-14 16:30:28 UTC (rev 9667) +++ trunk/lib/editpage.php 2015-04-14 16:31:05 UTC (rev 9668) @@ -774,17 +774,19 @@ if (defined('TOOLBAR_IMAGE_PULLDOWN') and TOOLBAR_IMAGE_PULLDOWN) { $toolbar->pushContent($this->imagePulldown()); } - $toolbar->pushContent(HTML::img(array('src' => $WikiTheme->getImageURL("ed_replace.png"), - 'class' => 'toolbar', - 'alt' => _('Search & Replace'), - 'title' => _('Search & Replace'), - 'onclick' => "replace();"))); - $toolbar->pushContent(HTML::img(array('src' => $WikiTheme->getImageURL("ed_undo_d.png"), - 'class' => 'toolbar', - 'id' => 'sr_undo', - 'alt' => _('Undo Search & Replace'), - 'title' => _('Undo Search & Replace'), - 'onclick' => "do_undo();"))); + if (defined('JS_SEARCHREPLACE') and JS_SEARCHREPLACE) { + $toolbar->pushContent(HTML::img(array('src' => $WikiTheme->getImageURL("ed_replace.png"), + 'class' => 'toolbar', + 'alt' => _('Search & Replace'), + 'title' => _('Search & Replace'), + 'onclick' => "replace();"))); + $toolbar->pushContent(HTML::img(array('src' => $WikiTheme->getImageURL("ed_undo_d.png"), + 'class' => 'toolbar', + 'id' => 'sr_undo', + 'alt' => _('Undo Search & Replace'), + 'title' => _('Undo Search & Replace'), + 'onclick' => "do_undo();"))); + } return HTML($toolbar, $textarea); } else { return $textarea; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2025-02-22 04:28:05
|
Revision: 11157 http://sourceforge.net/p/phpwiki/code/11157 Author: carstenklapp Date: 2025-02-22 04:28:03 +0000 (Sat, 22 Feb 2025) Log Message: ----------- Rollback some changes to LoadFileConflictPageEditor which broke saving merged edits. Fixed unset variable and clarified text in getConflictMessage. Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2025-02-21 01:50:21 UTC (rev 11156) +++ trunk/lib/editpage.php 2025-02-22 04:28:03 UTC (rev 11157) @@ -1297,6 +1297,9 @@ public function editPage($saveFailed = true) { $tokens = &$this->tokens; + if (!isset($tokens['EDITING_OLD_REVISION_MESSAGE'])) { + $tokens['EDITING_OLD_REVISION_MESSAGE'] = ''; + } if (!$this->canEdit()) { if ($this->isInitialEdit()) { @@ -1318,44 +1321,38 @@ // an array, or convert it as necesary. $orig = $this->page->getRevision($this->_currentVersion); $this_content = explode("\n", $this->_content); - $orig_content = $orig->getContent(); $other_content = $this->current->getContent(); - // require_once 'lib/diff.php'; - // $diff2 = new Diff($other_content, $this_content); - require_once 'lib/diff3.php'; - $diff2 = new diff3($orig_content, $this_content, $other_content); - $output = $diff2->merged_output(_("Loaded version"), _("Existing version")); - $this->_content = implode("\n", $output); - - // $context_lines = max( - // 4, - // count($other_content) + 1, - // count($this_content) + 1 - // ); - // $fmt = new BlockDiffFormatter($context_lines); - // $this->_content = $fmt->format($diff2); + require_once 'lib/diff.php'; + $diff2 = new Diff($other_content, $this_content); + $context_lines = max( + 4, + count($other_content) + 1, + count($this_content) + 1 + ); + $fmt = new BlockDiffFormatter($context_lines); + $this->_content = $fmt->format($diff2); // FIXME: integrate this into class BlockDiffFormatter - // $this->_content = str_replace( - // ">>>>>>>\n<<<<<<<\n", - // " ~=======\n", - // $this->_content - // ); - // $this->_content = str_replace( - // "<<<<<<<\n>>>>>>>\n", - // " ~=======\n", - // $this->_content - // ); - // // reformat diff markers to prevent from being interpreted as markup - // $this->_content = str_replace( - // "<<<<<<<\n", - // " ~<<<<<<<\n", - // $this->_content - // ); - // $this->_content = str_replace( - // ">>>>>>>\n", - // " ~>>>>>>>\n", - // $this->_content - // ); + $this->_content = str_replace( + ">>>>>>>\n<<<<<<<\n", + " ~=======\n", + $this->_content + ); + $this->_content = str_replace( + "<<<<<<<\n>>>>>>>\n", + " ~=======\n", + $this->_content + ); + // reformat diff markers to prevent from being interpreted as markup + $this->_content = str_replace( + "\n<<<<<<<\n", + "\n ~<<<<<<<\n", + $this->_content + ); + $this->_content = str_replace( + "\n>>>>>>>\n", + "\n ~>>>>>>>\n", + $this->_content + ); $this->_currentVersion = $this->current->getVersion(); $this->version = $this->_currentVersion;//fixme: is this correct? apples to EDITING_OLD_REVISION_MESSAGE also. $this->selected->getVersion() @@ -1369,10 +1366,10 @@ $tokens['PREVIEW_CONTENT'] = $this->getPreview(); } // FIXME: convert to _MESSAGE? - // FIXME: NOT_CURRENT_MESSAGE? ok trying - if (($this->version > 0) && ($this->version < $this->_currentVersion)) { - $tokens['EDITING_OLD_REVISION_MESSAGE'] = $this->getEditOldmsg(); - } + // // FIXME: NOT_CURRENT_MESSAGE? probably not needed in the context of restoring from pgsrc + // if (($this->version > 0) && ($this->version < $this->_currentVersion)) { + // $tokens['EDITING_OLD_REVISION_MESSAGE'] = $this->getEditOldmsg(); + // } $tokens = array_merge($tokens, $this->getFormElements()); // we need all GET params for loadfile overwrite @@ -1436,9 +1433,10 @@ { return HTML(HTML::p( fmt( - "Some of the changes could not automatically be combined. Please look for sections beginning with “%s”, and ending with “%s”. You will need to edit those sections by hand before you click Save.", + _("The version differences are sections marked by “%s”, “%s”, and “%s”. You will need to edit those sections by hand before you click Save."), "<<<<<<<", - "=======" + "=======", + ">>>>>>>" ), HTML::p(_("Please check it through before saving.")) )); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-06-10 08:41:52
|
Revision: 9698 http://sourceforge.net/p/phpwiki/code/9698 Author: vargenau Date: 2015-06-10 08:41:50 +0000 (Wed, 10 Jun 2015) Log Message: ----------- fix RedirectTo button Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2015-05-12 14:32:46 UTC (rev 9697) +++ trunk/lib/editpage.php 2015-06-10 08:41:50 UTC (rev 9698) @@ -756,7 +756,7 @@ 'class' => 'toolbar', 'alt' => _('Redirect'), 'title' => _('Redirect'), - 'onclick' => "insertTags('<<RedirectTo page="','">>','"._('Page Name')."'); return true;"))); + 'onclick' => "insertTags('<<RedirectTo page=\"','\">>','"._('Page Name')."'); return true;"))); $toolbar->pushContent(HTML::img(array('src' => $WikiTheme->getImageURL("ed_templateplugin.png"), 'class' => 'toolbar', 'alt' => _('Insert Dynamic Template'), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-20 11:32:16
|
Revision: 10589 http://sourceforge.net/p/phpwiki/code/10589 Author: vargenau Date: 2021-09-20 11:32:14 +0000 (Mon, 20 Sep 2021) Log Message: ----------- functions pagesPulldown and templatePulldown need no parameter Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2021-09-20 10:43:14 UTC (rev 10588) +++ trunk/lib/editpage.php 2021-09-20 11:32:14 UTC (rev 10589) @@ -186,10 +186,9 @@ return true; } elseif ($this->editaction == 'upload') { // run plugin UpLoad - $plugin = new WikiPluginLoader("UpLoad"); + $plugin = new WikiPluginLoader(); $plugin->run(); // add link to content - ; } if ($saveFailed and $this->isConcurrentUpdate()) { @@ -792,12 +791,12 @@ 'title' => _('Insert Dynamic Template'), 'onclick' => "insertTags('{{','}}','"._('Template Name')."'); return true;"))); if (defined('TOOLBAR_TEMPLATE_PULLDOWN') and TOOLBAR_TEMPLATE_PULLDOWN) { - $toolbar->pushContent($this->templatePulldown(TOOLBAR_TEMPLATE_PULLDOWN)); + $toolbar->pushContent($this->templatePulldown()); } $toolbar->pushContent($this->categoriesPulldown()); $toolbar->pushContent($this->pluginPulldown()); if (defined('TOOLBAR_PAGELINK_PULLDOWN') and TOOLBAR_PAGELINK_PULLDOWN) { - $toolbar->pushContent($this->pagesPulldown(TOOLBAR_PAGELINK_PULLDOWN)); + $toolbar->pushContent($this->pagesPulldown()); } if (defined('TOOLBAR_IMAGE_PULLDOWN') and TOOLBAR_IMAGE_PULLDOWN) { $toolbar->pushContent($this->imagePulldown()); @@ -904,7 +903,7 @@ return ''; } - private function pagesPulldown($query) + private function pagesPulldown() { /** * @var WikiRequest $request @@ -913,7 +912,7 @@ require_once 'lib/TextSearchQuery.php'; $dbi =& $request->_dbi; - $page_iter = $dbi->titleSearch(new TextSearchQuery($query, false, 'auto')); + $page_iter = $dbi->titleSearch(new TextSearchQuery(TOOLBAR_PAGELINK_PULLDOWN, false, 'auto')); if ($page_iter->count() > 0) { global $WikiTheme; $pages = array(); @@ -935,12 +934,12 @@ return ''; } - private function templatePulldown($query) + private function templatePulldown() { global $request; require_once 'lib/TextSearchQuery.php'; $dbi =& $request->_dbi; - $page_iter = $dbi->titleSearch(new TextSearchQuery($query, false, 'auto')); + $page_iter = $dbi->titleSearch(new TextSearchQuery(TOOLBAR_TEMPLATE_PULLDOWN, false, 'auto')); if ($page_iter->count()) { global $WikiTheme; $pages_js = ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-01-05 16:23:06
|
Revision: 10826 http://sourceforge.net/p/phpwiki/code/10826 Author: vargenau Date: 2022-01-05 16:23:04 +0000 (Wed, 05 Jan 2022) Log Message: ----------- lib/editpage.php: avoid warning Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2022-01-05 16:09:55 UTC (rev 10825) +++ trunk/lib/editpage.php 2022-01-05 16:23:04 UTC (rev 10826) @@ -315,10 +315,10 @@ { $request = &$this->request; + $lock_changed = false; if ($this->isUnchanged()) { // Allow admin lock/unlock even if // no text changes were made. - $lock_changed = false; if ($this->updateLock()) { $lock_changed = true; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2025-02-19 12:59:18
|
Revision: 11136 http://sourceforge.net/p/phpwiki/code/11136 Author: vargenau Date: 2025-02-19 12:59:16 +0000 (Wed, 19 Feb 2025) Log Message: ----------- Less strings to transalate Modified Paths: -------------- trunk/lib/editpage.php Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2025-02-19 12:57:55 UTC (rev 11135) +++ trunk/lib/editpage.php 2025-02-19 12:59:16 UTC (rev 11136) @@ -599,7 +599,7 @@ $html->pushContent( HTML::p( array('class' => "warning_msg"), - HTML::span(array('class' => "bold"), _("Warning:")), + HTML::span(array('class' => "bold"), _("Warning")._(":")), " " ._("You are editing an old version of this page.") ." ". _("Saving this page will overwrite the current version.") ), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |