Update of /cvsroot/phpwebsite-comm/modules/whatsnew/class
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv862/class
Modified Files:
Whatsnew.php Whatsnew_Forms.php
Log Message:
new features prepping for 0.4.0
Index: Whatsnew.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/whatsnew/class/Whatsnew.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Whatsnew.php 26 Jul 2008 21:02:36 -0000 1.4
--- Whatsnew.php 10 Feb 2009 23:11:54 -0000 1.5
***************
*** 208,211 ****
--- 208,219 ----
}
+ isset($_POST['show_summaries']) ?
+ PHPWS_Settings::set('whatsnew', 'show_summaries', 1) :
+ PHPWS_Settings::set('whatsnew', 'show_summaries', 0);
+
+ isset($_POST['show_dates']) ?
+ PHPWS_Settings::set('whatsnew', 'show_dates', 1) :
+ PHPWS_Settings::set('whatsnew', 'show_dates', 0);
+
if (isset($_POST['exclude'])) {
PHPWS_Settings::set('whatsnew', 'exclude', $_POST['exclude']);
***************
*** 300,304 ****
}
! $final = null;
$exclude = unserialize(PHPWS_Settings::get('whatsnew', 'exclude'));
$db = new PHPWS_DB('phpws_key');
--- 308,315 ----
}
! $link = null;
! $summary = null;
! $date = null;
!
$exclude = unserialize(PHPWS_Settings::get('whatsnew', 'exclude'));
$db = new PHPWS_DB('phpws_key');
***************
*** 321,330 ****
$tpl['TEXT'] = PHPWS_Text::parseOutput(PHPWS_Settings::get('whatsnew', 'text'));
if (!PHPWS_Error::logIfError($result) && !empty($result)) {
! foreach ($result as $link) {
! $final = '<a href="' . $link['url'] . '">' . $link['title'] . '</a>';
! $tpl['new-links'][] = array('LINK'=>$final);
}
} else {
! $tpl['new-links'][] = array('LINK'=>dgettext('whatsnew', 'Sorry, no results'));
}
--- 332,347 ----
$tpl['TEXT'] = PHPWS_Text::parseOutput(PHPWS_Settings::get('whatsnew', 'text'));
if (!PHPWS_Error::logIfError($result) && !empty($result)) {
! foreach ($result as $item) {
! $link = '<a href="' . $item['url'] . '">' . $item['title'] . '</a>';
! if (PHPWS_Settings::get('whatsnew', 'show_summaries')) {
! $summary = PHPWS_Text::parseOutput($item['summary']);
! }
! if (PHPWS_Settings::get('whatsnew', 'show_dates')) {
! $date = strftime(WHATSNEW_DATE_FORMAT, $item['update_date']);
! }
! $tpl['new-items'][] = array('LINK'=>$link, 'SUMMARY'=>$summary, 'DATE'=>$date);
}
} else {
! $tpl['new-items'][] = array('LINK'=>dgettext('whatsnew', 'Sorry, no results'));
}
Index: Whatsnew_Forms.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/whatsnew/class/Whatsnew_Forms.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Whatsnew_Forms.php 26 Jul 2008 21:02:36 -0000 1.3
--- Whatsnew_Forms.php 10 Feb 2009 23:11:54 -0000 1.4
***************
*** 77,80 ****
--- 77,88 ----
$form->setSize('qty_items', 4,4);
+ $form->addCheckbox('show_summaries', 1);
+ $form->setMatch('show_summaries', PHPWS_Settings::get('whatsnew', 'show_summaries'));
+ $form->setLabel('show_summaries', dgettext('whatsnew', 'Show item summaries'));
+
+ $form->addCheckbox('show_dates', 1);
+ $form->setMatch('show_dates', PHPWS_Settings::get('whatsnew', 'show_dates'));
+ $form->setLabel('show_dates', dgettext('whatsnew', 'Show item update dates'));
+
$form->addSubmit('save', dgettext('whatsnew', 'Save settings'));
|