|
From: Verdon V. <ve...@us...> - 2008-06-16 18:21:40
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12343/class Modified Files: RDX_Feature.php RDX_Location.php RDX_Member.php RDX_Mypage.php Rolodex.php Log Message: tweaks to support features locations etc Index: RDX_Feature.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Feature.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RDX_Feature.php 16 Jun 2008 15:59:19 -0000 1.2 --- RDX_Feature.php 16 Jun 2008 18:21:32 -0000 1.3 *************** *** 276,284 **** } ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', array('uop'=>'list')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Locations'), "rolodex", array('uop'=>'locations')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Features'), "rolodex", array('uop'=>'features')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Advanced'), "rolodex", array('uop'=>'advanced')); if($links) --- 276,280 ---- } ! $links = array_merge($links, Rolodex::navLinks()); if($links) Index: RDX_Location.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Location.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RDX_Location.php 16 Jun 2008 15:59:19 -0000 1.2 --- RDX_Location.php 16 Jun 2008 18:21:33 -0000 1.3 *************** *** 274,283 **** $links[] = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit location'), 'rolodex', $vars); } ! ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', array('uop'=>'list')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Locations'), "rolodex", array('uop'=>'locations')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Features'), "rolodex", array('uop'=>'features')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Advanced'), "rolodex", array('uop'=>'advanced')); if($links) --- 274,279 ---- $links[] = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit location'), 'rolodex', $vars); } ! ! $links = array_merge($links, Rolodex::navLinks()); if($links) Index: Rolodex.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/Rolodex.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Rolodex.php 13 Jun 2008 03:51:17 -0000 1.9 --- Rolodex.php 16 Jun 2008 18:21:33 -0000 1.10 *************** *** 1377,1380 **** --- 1377,1413 ---- + function navLinks() + { + + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', array('uop'=>'list')); + + $db = new PHPWS_DB('category_items'); + $db->addWhere('module', 'rolodex'); + $categories = $db->count(); + if ($categories > 0) { + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')); + } + + $db = new PHPWS_DB('rolodex_location'); + $locations = $db->count(); + if ($locations > 0) { + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Locations'), "rolodex", array('uop'=>'locations')); + } + + $db = new PHPWS_DB('rolodex_feature'); + $features = $db->count(); + if ($features > 0) { + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Features'), "rolodex", array('uop'=>'features')); + } + + $db = new PHPWS_DB('rolodex_feature'); + $features = $db->count(); + if ($categories > 0 || $locations > 0 || $features > 0) { + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Advanced'), "rolodex", array('uop'=>'advanced')); + } + + return $links; + } + function alpha_click() { *************** *** 1404,1408 **** $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('uop'=>'list')) . "\n"; - // $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')) . "\n"; } elseif (@$_REQUEST['aop'] == "list_expired") { $vars['aop'] = 'list_expired'; --- 1437,1440 ---- *************** *** 1410,1414 **** $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('aop'=>'list_expired')) . "\n"; - // $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')) . "\n"; } else { $vars['uop'] = 'list'; --- 1442,1445 ---- *************** *** 1416,1426 **** $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('uop'=>'list')) . "\n"; - // $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')) . "\n"; } ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Locations'), "rolodex", array('uop'=>'locations')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Features'), "rolodex", array('uop'=>'features')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Advanced'), "rolodex", array('uop'=>'advanced')); $tpl['LIST'] = implode(' | ', $alpha); --- 1447,1453 ---- $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('uop'=>'list')) . "\n"; } ! $links = $this->navLinks(); $tpl['LIST'] = implode(' | ', $alpha); *************** *** 1550,1567 **** } ! if ($multiple) { ! $form = new PHPWS_Form; ! $form->addMultiple($select_name, $items); ! if (!empty($match) && is_array($match)) { ! $form->setMatch($select_name, $match); } - return $form->get($select_name); } else { ! $form = new PHPWS_Form; ! $form->addSelect($select_name, $items); ! if (!empty($match) && is_string($match)) { ! $form->setMatch($select_name, $match); ! } ! return $form->get($select_name); } --- 1577,1598 ---- } ! if ($items) { ! if ($multiple) { ! $form = new PHPWS_Form; ! $form->addMultiple($select_name, $items); ! if (!empty($match) && is_array($match)) { ! $form->setMatch($select_name, $match); ! } ! return $form->get($select_name); ! } else { ! $form = new PHPWS_Form; ! $form->addSelect($select_name, $items); ! if (!empty($match) && is_string($match)) { ! $form->setMatch($select_name, $match); ! } ! return $form->get($select_name); } } else { ! return dgettext('rolodex', 'No choices configured.'); } *************** *** 1592,1609 **** } ! if ($multiple) { ! $form = new PHPWS_Form; ! $form->addMultiple($select_name, $items); ! if (!empty($match) && is_array($match)) { ! $form->setMatch($select_name, $match); } - return $form->get($select_name); } else { ! $form = new PHPWS_Form; ! $form->addSelect($select_name, $items); ! if (!empty($match) && is_string($match)) { ! $form->setMatch($select_name, $match); ! } ! return $form->get($select_name); } --- 1623,1644 ---- } ! if ($items) { ! if ($multiple) { ! $form = new PHPWS_Form; ! $form->addMultiple($select_name, $items); ! if (!empty($match) && is_array($match)) { ! $form->setMatch($select_name, $match); ! } ! return $form->get($select_name); ! } else { ! $form = new PHPWS_Form; ! $form->addSelect($select_name, $items); ! if (!empty($match) && is_string($match)) { ! $form->setMatch($select_name, $match); ! } ! return $form->get($select_name); } } else { ! return dgettext('rolodex', 'No choices configured.'); } Index: RDX_Mypage.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Mypage.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RDX_Mypage.php 16 Jun 2008 15:59:19 -0000 1.5 --- RDX_Mypage.php 16 Jun 2008 18:21:33 -0000 1.6 *************** *** 24,27 **** --- 24,28 ---- + PHPWS_Core::initModClass('rolodex', 'Rolodex.php'); class Rolodex_Mypage { *************** *** 51,54 **** --- 52,57 ---- } } + + /* $vars2['uop'] = 'list'; $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', $vars2); *************** *** 57,60 **** --- 60,66 ---- $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Features'), "rolodex", array('uop'=>'features')); $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Advanced'), "rolodex", array('uop'=>'advanced')); + */ + $links = array_merge($links, Rolodex::navLinks()); + $tpl['CONTENT'] = implode(' | ', $links); $tpl['CONTENT'] .= Rolodex_Mypage::searchForm(); Index: RDX_Member.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Member.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RDX_Member.php 16 Jun 2008 15:59:19 -0000 1.8 --- RDX_Member.php 16 Jun 2008 18:21:33 -0000 1.9 *************** *** 138,148 **** $result = $db->select('col'); if ($print) { ! PHPWS_Core::initModClass('rolodex', 'RDX_Location.php'); ! foreach ($result as $id){ ! $location = new Rolodex_Location($id); ! if ($nolink) { ! $link[] = $location->getTitle(true); ! } else { ! $link[] = $location->viewLink(); } } --- 138,152 ---- $result = $db->select('col'); if ($print) { ! if (empty($result)) { ! $link[] = null; ! } else { ! PHPWS_Core::initModClass('rolodex', 'RDX_Location.php'); ! foreach ($result as $id){ ! $location = new Rolodex_Location($id); ! if ($nolink) { ! $link[] = $location->getTitle(true); ! } else { ! $link[] = $location->viewLink(); ! } } } *************** *** 160,170 **** $result = $db->select('col'); if ($print) { ! PHPWS_Core::initModClass('rolodex', 'RDX_Feature.php'); ! foreach ($result as $id){ ! $feature = new Rolodex_Feature($id); ! if ($nolink) { ! $link[] = $feature->getTitle(true); ! } else { ! $link[] = $feature->viewLink(); } } --- 164,178 ---- $result = $db->select('col'); if ($print) { ! if (empty($result)) { ! $link[] = null; ! } else { ! PHPWS_Core::initModClass('rolodex', 'RDX_Feature.php'); ! foreach ($result as $id){ ! $feature = new Rolodex_Feature($id); ! if ($nolink) { ! $link[] = $feature->getTitle(true); ! } else { ! $link[] = $feature->viewLink(); ! } } } *************** *** 1085,1093 **** $links[] = $this->editLink(); } ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', array('uop'=>'list')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Locations'), "rolodex", array('uop'=>'locations')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Features'), "rolodex", array('uop'=>'features')); ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Advanced'), "rolodex", array('uop'=>'advanced')); if($links) --- 1093,1098 ---- $links[] = $this->editLink(); } ! ! $links = array_merge($links, Rolodex::navLinks()); if($links) |