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. |