|
From: Eloi G. <ada...@us...> - 2008-10-13 14:04:07
|
Update of /cvsroot/phpwebsite-comm/modules/article/class In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14401/class Modified Files: AM_DisplayForms.php AM_Lists.php AM_Data.php Log Message: An "Editable Articles Only" filter is added to the search menu Index: AM_Data.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/class/AM_Data.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** AM_Data.php 11 Oct 2008 06:13:49 -0000 1.18 --- AM_Data.php 13 Oct 2008 14:03:54 -0000 1.19 *************** *** 374,377 **** --- 374,382 ---- $s_arr['updater_name'] = $_REQUEST['updater_name']; + if(isset($_REQUEST['editable_only'])) + $s_arr['editable_only'] = 1; + else + $s_arr['editable_only'] = 0; + if(!empty($_REQUEST['searchtext'])) $s_arr['searchtext'] = preg_replace('/\W/', '', $_REQUEST['searchtext']);; Index: AM_Lists.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/class/AM_Lists.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** AM_Lists.php 11 Oct 2008 06:13:49 -0000 1.20 --- AM_Lists.php 13 Oct 2008 14:03:54 -0000 1.21 *************** *** 148,158 **** break; } ! ! /* text */ ! if (!empty($s_arr['searchtext'])) { ! $db->addWhere('title', '%' . $s_arr['searchtext']. '%', 'like', 'or', 'textsearch'); ! $db->addWhere('summary', '%' . $s_arr['searchtext']. '%', 'like', 'or', 'textsearch'); ! $db->addWhere('pages', '%' . $s_arr['searchtext']. '%', 'like', 'or', 'textsearch'); ! } } --- 148,166 ---- break; } ! ! /* editable_only */ ! if (!empty($s_arr['editable_only'])) { ! Key::restrictEdit($db, 'article', 'edit_articles'); ! $db->addWhere('created_id', Current_User::getId(), null, 'or','key_1'); ! } ! else ! Key::restrictView($db, 'article'); ! ! /* text */ ! if (!empty($s_arr['searchtext'])) { ! $db->addWhere('title', '%' . $s_arr['searchtext']. '%', 'like', 'or', 'textsearch'); ! $db->addWhere('summary', '%' . $s_arr['searchtext']. '%', 'like', 'or', 'textsearch'); ! $db->addWhere('pages', '%' . $s_arr['searchtext']. '%', 'like', 'or', 'textsearch'); ! } } *************** *** 290,294 **** if(!empty($search_params['orderby'])) $pager->setOrder($search_params['orderby'], $search_params['orderby_dir']); - Key::restrictView($pager->db, 'article'); $lbls = array(); --- 298,301 ---- *************** *** 338,342 **** $pager->addPageTags($lbls); $content = $pager->get(); ! /* This trick is from http://www.madaboutstyle.com/tooltip2.html */ Layout::addStyle('article'); --- 345,349 ---- $pager->addPageTags($lbls); $content = $pager->get(); ! /* This trick is from http://www.madaboutstyle.com/tooltip2.html */ Layout::addStyle('article'); Index: AM_DisplayForms.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/class/AM_DisplayForms.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AM_DisplayForms.php 21 Aug 2008 20:17:32 -0000 1.5 --- AM_DisplayForms.php 13 Oct 2008 14:03:54 -0000 1.6 *************** *** 159,163 **** $tags['UPDATER_LABEL'] = dgettext('article', 'Last updated by'); $tags['UPDATER_3_LBL'] = '<input name="updater_name" value="'.$s_arr['updater_name'].'" size="20" maxlength="30" type="text">'; ! /* text search */ $form->addText('searchtext', $s_arr['searchtext']); --- 159,168 ---- $tags['UPDATER_LABEL'] = dgettext('article', 'Last updated by'); $tags['UPDATER_3_LBL'] = '<input name="updater_name" value="'.$s_arr['updater_name'].'" size="20" maxlength="30" type="text">'; ! ! /* editable_only */ ! $form->addCheckbox('editable_only'); ! $form->setMatch('editable_only', $s_arr['editable_only']); ! $form->setLabel('editable_only', dgettext('article', 'Editable articles only')); ! /* text search */ $form->addText('searchtext', $s_arr['searchtext']); |