|
From: Eloi G. <ada...@us...> - 2008-11-19 06:01:34
|
Update of /cvsroot/phpwebsite-comm/modules/article In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29487 Modified Files: index_admin.php Log Message: If set in the AM settings, all changes to articles are now summarized in /logs/event.log Index: index_admin.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/index_admin.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** index_admin.php 18 Nov 2008 05:00:16 -0000 1.23 --- index_admin.php 19 Nov 2008 06:01:26 -0000 1.24 *************** *** 252,258 **** $article->approved = 0; $article->draft = 1; ! $message = 'Your article is being held as an unapproved rough draft.'; ! if (AMupdate($article, $message)==true) ! AMexit($article, $panel, $title, $content); else $content = $article->edit($page); --- 252,259 ---- $article->approved = 0; $article->draft = 1; ! $message = sprintf(dgettext('article', 'Article %s ("%s") has been saved as an unapproved rough draft'), $article->id, $article->title); ! if (AMupdate($article, $message)==true) { ! AMexit($article, $panel, $title, $content); ! } else $content = $article->edit($page); *************** *** 268,274 **** $article->approved = 1; $article->draft = 0; ! $message = 'Your article is automatically approved.'; ! if (AMupdate($article, $message)==true) ! AMexit($article, $panel, $title, $content); else $content = $article->edit($page); --- 269,276 ---- $article->approved = 1; $article->draft = 0; ! $message = sprintf(dgettext('article', 'Article %s ("%s") has been saved, approved and published'), $article->id, $article->title); ! if (AMupdate($article, $message)==true) { ! AMexit($article, $panel, $title, $content); ! } else $content = $article->edit($page); *************** *** 288,294 **** $article->approved = 0; $article->draft = 0; ! $message = 'Your article is being held for approval.<br />You however, will still be able to see and edit it.'; ! if (AMupdate($article, $message)==true) ! AMexit($article, $panel, $title, $content); else $content = $article->edit($page); --- 290,297 ---- $article->approved = 0; $article->draft = 0; ! $message = sprintf(dgettext('article', 'Article %s ("%s") is being held for approval.<br />You however, will still be able to see and edit it.'), $article->id, $article->title); ! if (AMupdate($article, $message)==true) { ! AMexit($article, $panel, $title, $content); ! } else $content = $article->edit($page); *************** *** 303,307 **** { $article->setEditLock(FALSE); ! $message .= sprintf(dgettext('article', 'Article %s ("%s") has been unlocked'), $article->id, $article->title)."<br />\n"; } } --- 306,310 ---- { $article->setEditLock(FALSE); ! $message .= sprintf(dgettext('article', 'Article %s ("%s") has been unlocked'), $article->id, $article->title)."<br />\n"; } } *************** *** 317,321 **** if (Current_User::allow('article', 'delete_articles', $article->id)) { $article->delete(); ! $message .= sprintf(dgettext('article', 'Article %s ("%s") has been deleted'), $article->id, $article->title)."<br />\n"; } else --- 320,324 ---- if (Current_User::allow('article', 'delete_articles', $article->id)) { $article->delete(); ! $message .= sprintf(dgettext('article', 'Article %s ("%s") has been deleted'), $article->id, $article->title)."<br />\n"; } else *************** *** 334,338 **** { $article->expire(); ! $message .= sprintf(dgettext('article', 'Article %s ("%s") has been expired'), $article->id, $article->title)."<br />\n"; } } --- 337,341 ---- { $article->expire(); ! $message .= sprintf(dgettext('article', 'Article %s ("%s") has been expired'), $article->id, $article->title)."<br />\n"; } } *************** *** 586,590 **** if (!Current_User::isUnrestricted('article')) break; ! switch($_REQUEST['action']) { case 'save': --- 589,593 ---- if (!Current_User::isUnrestricted('article')) break; ! switch(@$_REQUEST['action']) { case 'save': *************** *** 622,627 **** if (!empty($title)) $template['TITLE'] = $title; ! if (!empty($message)) ! $template['MESSAGE'] = $message; if (!empty($content)) $template['CONTENT'] = $content; --- 625,632 ---- if (!empty($title)) $template['TITLE'] = $title; ! if (!empty($message)) { ! $template['MESSAGE'] = $message; ! log_event($message); ! } if (!empty($content)) $template['CONTENT'] = $content; *************** *** 647,651 **** , 'link' => 'index.php?module=article&op=viewhistory&id='.$_REQUEST['id']); $panel->quickSetTabs($tab); ! } --- 652,656 ---- , 'link' => 'index.php?module=article&op=viewhistory&id='.$_REQUEST['id']); $panel->quickSetTabs($tab); ! } *************** *** 658,662 **** } return true; ! } --- 663,667 ---- } return true; ! } *************** *** 676,680 **** } - function AMexit (& $article, & $panel, & $title, & $content) { $article->setEditLock(0); --- 681,684 ---- *************** *** 683,687 **** $title = dgettext('article', 'Main Menu'); $content = PHPWS_AM_Lists::list_articles(); ! } function AMredirect ($id, $page, $anchor = '') { --- 687,692 ---- $title = dgettext('article', 'Main Menu'); $content = PHPWS_AM_Lists::list_articles(); ! } ! function AMredirect ($id, $page, $anchor = '') { *************** *** 691,695 **** PHPWS_Core::reroute('index.php?module=article&op=edit&id='.$id.'&page='.$page.$anchor); exit(); ! } --- 696,700 ---- PHPWS_Core::reroute('index.php?module=article&op=edit&id='.$id.'&page='.$page.$anchor); exit(); ! } *************** *** 737,741 **** return $article; } ! ?> \ No newline at end of file --- 742,758 ---- return $article; } ! ! function log_event($message, $type = 'Notice') { ! if (!$GLOBALS['Article']['val']['log_events']) ! return; ! if (Current_User::isLogged()) ! $username = Current_User::getUsername(); ! else ! $username = _('Unknown user'); ! ! $ip = $_SERVER['REMOTE_ADDR']; ! $event = sprintf('%s@%s -- %s', $username, $ip, $message); ! PHPWS_Core::log(escapeshellcmd($event), 'event.log', $type); ! } ?> \ No newline at end of file |