From: <ru...@us...> - 2010-06-07 10:59:55
|
Revision: 7473 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7473&view=rev Author: rurban Date: 2010-06-07 10:59:48 +0000 (Mon, 07 Jun 2010) Log Message: ----------- simplify if GFORGE Modified Paths: -------------- trunk/lib/EditToolbar.php trunk/lib/MailNotify.php Modified: trunk/lib/EditToolbar.php =================================================================== --- trunk/lib/EditToolbar.php 2010-06-07 10:55:52 UTC (rev 7472) +++ trunk/lib/EditToolbar.php 2010-06-07 10:59:48 UTC (rev 7473) @@ -68,12 +68,13 @@ } if (ENABLE_EDIT_TOOLBAR) { - $js = JavaScript('',array('src' => $WikiTheme->_findData("toolbar.js"))); - if (empty($WikiTheme->_headers_printed)) - $WikiTheme->addMoreHeaders($js); + $js = JavaScript('',array('src' => $WikiTheme->_findData("toolbar.js"))); + if (empty($WikiTheme->_headers_printed)) { + $WikiTheme->addMoreHeaders($js); + } else { // from an actionpage: WikiBlog, AddComment, WikiForum - printXML($js); - printXML(JavaScript('define_f()')); + printXML($js); + printXML(JavaScript('define_f()')); } } @@ -96,8 +97,8 @@ $this->tokens['EDIT_TOOLBAR'] =& $content; } else { $content = $this->_generate(); - // regenerate buttons every 3600 seconds - $cache->save($id, $content, '+3600', 'toolbarcache'); + // regenerate buttons every 1 hr/6 hrs + $cache->save($id, $content, DEBUG ? '+3600' : '+21600', 'toolbarcache'); $this->tokens['EDIT_TOOLBAR'] =& $content; } } @@ -113,10 +114,8 @@ if (ENABLE_EDIT_TOOLBAR) { $username = $request->_user->UserName(); - if (defined('GFORGE') and GFORGE) { + if (GFORGE or DISABLE_MARKUP_WIKIWORD or (!isWikiWord($username))) { $username = '[['.$username.']]'; - } else if (DISABLE_MARKUP_WIKIWORD or (!isWikiWord($username))) { - $username = '['.$username.']'; } $signature = " ––".$username." ".CTime(); $toolarray = array( @@ -303,7 +302,7 @@ $categories = array(); while ($p = $pages->next()) { $page = $p->getName(); - if (defined('GFORGE') and GFORGE) { + if (GFORGE) { $categories[] = "['$page', '%0A----%0A%5B%5B".$page."%5D%5D']"; } else if (DISABLE_MARKUP_WIKIWORD or (!isWikiWord($page))) { $categories[] = "['$page', '%0A%5B".$page."%5D']"; @@ -383,7 +382,7 @@ require_once('lib/TextSearchQuery.php'); $dbi =& $GLOBALS['request']->_dbi; $page_iter = $dbi->titleSearch(new TextSearchQuery($query, $case_exact, $regex)); - if ($page_iter->count()) { + if ($page_iter->count() > 0) { global $WikiTheme; $pages = array(); while ($p = $page_iter->next()) { @@ -415,6 +414,12 @@ $pd = new fileSet($image_dir, '*'); $images = $pd->getFiles(); unset($pd); + if (UPLOAD_USERDIR) { + $image_dir .= "/" . $request->_user->_userid; + $pd = new fileSet($image_dir, '*'); + $images = array_merge($images, $pd->getFiles()); + unset($pd); + } sort($images); if (!empty($images)) { $image_js = ''; Modified: trunk/lib/MailNotify.php =================================================================== --- trunk/lib/MailNotify.php 2010-06-07 10:55:52 UTC (rev 7472) +++ trunk/lib/MailNotify.php 2010-06-07 10:59:48 UTC (rev 7473) @@ -61,7 +61,7 @@ function fromId() { global $request; - if (defined('GFORGE') and GFORGE) { + if (GFORGE) { return $request->_user->getId(); } else { return $request->_user->getId() . '@' . $request->get('REMOTE_HOST'); @@ -72,7 +72,7 @@ global $request; // Disable verification of emails for corporate env. - if (defined('GFORGE') and GFORGE) { + if (GFORGE) { $doverify = false; } @@ -188,10 +188,8 @@ $emails = $this->emails; $from = $this->from; // Do not send if modification is from Gforge admin - if (defined('GFORGE') and GFORGE) { - if ($from == ADMIN_USER) { - return; - } + if (GFORGE and $from == ADMIN_USER) { + return; } if (!$notice) $notice = _("PageChange Notification of %s"); $headers = "From: $from\r\n" . This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |