|
From: Greg M. <bli...@us...> - 2008-01-03 17:18:40
|
Update of /cvsroot/phpwebsite-comm/modules/wiki/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4280/class Modified Files: OldWikiPage.php WikiPage.php WikiSettings.php Log Message: Switch to logIfError function Index: OldWikiPage.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/wiki/class/OldWikiPage.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** OldWikiPage.php 28 May 2007 19:00:16 -0000 1.26 --- OldWikiPage.php 3 Jan 2008 17:18:43 -0000 1.27 *************** *** 73,79 **** $db->addColumn('display_name'); $result = $db->select('col'); ! if (PEAR::isError($result)) { - PHPWS_Error::log($result); return dgettext('wiki', 'N/A'); } --- 73,78 ---- $db->addColumn('display_name'); $result = $db->select('col'); ! if (PHPWS_Error::logIfError($result)) { return dgettext('wiki', 'N/A'); } *************** *** 129,135 **** $db->addColumn('allow_edit'); $result = $db->select('col'); ! if (PEAR::isError($result)) { - PHPWS_Error::log($result); return 0; } --- 128,133 ---- $db->addColumn('allow_edit'); $result = $db->select('col'); ! if (PHPWS_Error::logIfError($result)) { return 0; } Index: WikiSettings.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/wiki/class/WikiSettings.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** WikiSettings.php 28 May 2007 19:00:16 -0000 1.14 --- WikiSettings.php 3 Jan 2008 17:18:43 -0000 1.15 *************** *** 273,280 **** PHPWS_Settings::set('wiki', 'discussion_anon', 0); ! $result = PHPWS_Settings::save('wiki'); ! if (PEAR::isError($result)) { - PHPWS_Error::log($result); return dgettext('wiki', 'There was an error saving the settings.'); } --- 273,278 ---- PHPWS_Settings::set('wiki', 'discussion_anon', 0); ! if (PHPWS_Error::logIfError(PHPWS_Settings::save('wiki'))) { return dgettext('wiki', 'There was an error saving the settings.'); } Index: WikiPage.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/wiki/class/WikiPage.php,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** WikiPage.php 28 May 2007 19:00:16 -0000 1.76 --- WikiPage.php 3 Jan 2008 17:18:43 -0000 1.77 *************** *** 107,113 **** $db->addColumn('display_name'); $result = $db->select('col'); ! if (PEAR::isError($result)) { - PHPWS_Error::log($result); return dgettext('wiki', 'N/A'); } --- 107,112 ---- $db->addColumn('display_name'); $result = $db->select('col'); ! if (PHPWS_Error::logIfError($result)) { return dgettext('wiki', 'N/A'); } *************** *** 177,185 **** { $db = new PHPWS_DB('wiki_pages'); ! $result = $db->saveObject($this); ! if (PEAR::isError($result)) ! { ! PHPWS_Error::log($result); ! } } } --- 176,180 ---- { $db = new PHPWS_DB('wiki_pages'); ! PHPWS_Error::logIfError($db->saveObject($this)); } } *************** *** 216,233 **** } ! if ($this->allow_edit) ! { ! $this->allow_edit = 0; ! } ! else ! { ! $this->allow_edit = 1; ! } ! ! $result = $this->save(FALSE); ! if (PEAR::isError($result)) ! { ! PHPWS_Error::log($result); ! } } --- 211,216 ---- } ! $this->allow_edit = ($this->allow_edit) ? 0 : 1; ! PHPWS_Error::logIfError($this->save(FALSE)); } *************** *** 442,449 **** $result = $this->save(); ! if (PEAR::isError($result)) { ! PHPWS_Error::log($result); ! WikiManager::sendMessage(dgettext('wiki', 'Page could not be saved.'), array('page'=>$this->getTitle(FALSE)), FALSE); } --- 425,432 ---- $result = $this->save(); ! if (PHPWS_Error::logIfError($result)) { ! WikiManager::sendMessage(dgettext('wiki', 'Page could not be saved.'), ! array('page'=>$this->getTitle(FALSE)), FALSE); } *************** *** 525,532 **** $db = new PHPWS_DB('wiki_pages'); $db->addWhere('id', $this->getId()); ! $result = $db->delete(); ! if (PEAR::isError($result)) { - PHPWS_Error::log($result); WikiManager::sendMessage(dgettext('wiki', 'Page could not be deleted.'), array('page'=>$this->getTitle(FALSE)), FALSE); --- 508,513 ---- $db = new PHPWS_DB('wiki_pages'); $db->addWhere('id', $this->getId()); ! if (PHPWS_Error::logIfError($db->delete())) { WikiManager::sendMessage(dgettext('wiki', 'Page could not be deleted.'), array('page'=>$this->getTitle(FALSE)), FALSE); *************** *** 537,545 **** $key = new Key($this->key_id); ! $result = $key->delete(); ! if (PEAR::isError($result)) ! { ! PHPWS_Error::log($result); ! } WikiManager::sendMessage(sprintf(dgettext('wiki', '%s deleted!'), $this->getTitle()), array(), FALSE); --- 518,522 ---- $key = new Key($this->key_id); ! PHPWS_Error::logIfError($key->delete()); WikiManager::sendMessage(sprintf(dgettext('wiki', '%s deleted!'), $this->getTitle()), array(), FALSE); *************** *** 612,633 **** $result = $db->select('col'); ! if (PEAR::isError($result)) { - PHPWS_Error::log($result); $tags['MESSAGE'] = dgettext('wiki', 'None'); } else { ! if ($result != NULL) ! { ! foreach ($result as $row) ! { ! $link = PHPWS_Text::moduleLink(WikiManager::formatTitle($row), 'wiki', array('page'=>$row)); ! $tags['LINKS'] .= PHPWS_Template::process(array('LINK'=>$link), 'wiki', 'whatlinkshere/link.tpl'); ! } ! } ! else { ! $tags['MESSAGE'] = dgettext('wiki', 'None'); } } --- 589,602 ---- $result = $db->select('col'); ! if (PHPWS_Error::logIfError($result) || ($result == NULL)) { $tags['MESSAGE'] = dgettext('wiki', 'None'); } else { ! foreach ($result as $row) { ! $link = PHPWS_Text::moduleLink(WikiManager::formatTitle($row), 'wiki', array('page'=>$row)); ! $tags['LINKS'] .= PHPWS_Template::process(array('LINK'=>$link), 'wiki', 'whatlinkshere/link.tpl'); } } |