|
From: Verdon V. <ve...@us...> - 2008-07-25 12:28:39
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6454/class Modified Files: RDX_Forms.php RDX_Member.php Rolodex.php Log Message: category, location, feature switches Index: RDX_Forms.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Forms.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** RDX_Forms.php 24 Jul 2008 20:08:51 -0000 1.21 --- RDX_Forms.php 25 Jul 2008 12:28:15 -0000 1.22 *************** *** 144,151 **** $tags['settings'] = array('title'=>dgettext('rolodex', 'Settings'), 'link'=>$link); ! $tags['locations'] = array('title'=>dgettext('rolodex', 'Locations'), ! 'link'=>$link); ! $tags['features'] = array('title'=>dgettext('rolodex', 'Features'), ! 'link'=>$link); } --- 144,155 ---- $tags['settings'] = array('title'=>dgettext('rolodex', 'Settings'), 'link'=>$link); ! if (PHPWS_Settings::get('rolodex', 'use_locations')) { ! $tags['locations'] = array('title'=>dgettext('rolodex', 'Locations'), ! 'link'=>$link); ! } ! if (PHPWS_Settings::get('rolodex', 'use_features')) { ! $tags['features'] = array('title'=>dgettext('rolodex', 'Features'), ! 'link'=>$link); ! } } *************** *** 599,602 **** --- 603,618 ---- $form->setLabel('admin_contact', dgettext('rolodex', 'The admin contact email address for this module')); + $form->addCheckbox('use_categories', 1); + $form->setMatch('use_categories', PHPWS_Settings::get('rolodex', 'use_categories')); + $form->setLabel('use_categories', dgettext('rolodex', 'Enable Categories')); + + $form->addCheckbox('use_locations', 1); + $form->setMatch('use_locations', PHPWS_Settings::get('rolodex', 'use_locations')); + $form->setLabel('use_locations', dgettext('rolodex', 'Enable Locations')); + + $form->addCheckbox('use_features', 1); + $form->setMatch('use_features', PHPWS_Settings::get('rolodex', 'use_features')); + $form->setLabel('use_features', dgettext('rolodex', 'Enable Features')); + $form->addCheckbox('comments_enable', 1); $form->setMatch('comments_enable', PHPWS_Settings::get('rolodex', 'comments_enable')); *************** *** 793,799 **** $tpl['LIST_SETTINGS_TIP'] = dgettext('rolodex', 'The following settings respect the privacy settings above and do not over-ride them.'); $tpl['LIST_ADDRESS_TITLE'] = dgettext('rolodex', 'Address to display on browse list views'); $tpl['COMMENTS_GROUP_LABEL'] = dgettext('rolodex', 'Comments Settings'); $tpl['PRIVACY_GROUP_LABEL'] = dgettext('rolodex', 'Privacy Settings'); ! $tpl['LIST_GROUP_LABEL'] = dgettext('rolodex', 'List Settings'); $tpl['IMAGE_GROUP_LABEL'] = dgettext('rolodex', 'Image Settings'); $tpl['FIELDS_GROUP_LABEL'] = dgettext('rolodex', 'Custom Fields'); --- 809,816 ---- $tpl['LIST_SETTINGS_TIP'] = dgettext('rolodex', 'The following settings respect the privacy settings above and do not over-ride them.'); $tpl['LIST_ADDRESS_TITLE'] = dgettext('rolodex', 'Address to display on browse list views'); + $tpl['OPTIONS_GROUP_LABEL'] = dgettext('rolodex', 'Organizing/Classifying Options'); $tpl['COMMENTS_GROUP_LABEL'] = dgettext('rolodex', 'Comments Settings'); $tpl['PRIVACY_GROUP_LABEL'] = dgettext('rolodex', 'Privacy Settings'); ! $tpl['LIST_GROUP_LABEL'] = dgettext('rolodex', 'List Options'); $tpl['IMAGE_GROUP_LABEL'] = dgettext('rolodex', 'Image Settings'); $tpl['FIELDS_GROUP_LABEL'] = dgettext('rolodex', 'Custom Fields'); *************** *** 1085,1094 **** $tpl = $form->getTemplate(); ! $tpl['CATEGORIES'] = Categories::getForm($match=$member->get_categories(), $select_name='categories', $multiple=true); ! $tpl['LOCATIONS'] = $this->rolodex->getItemForm('location', $match=$member->get_locations(), $select_name='locations', $multiple=true); ! $tpl['FEATURES'] = $this->rolodex->getItemForm('feature', $match=$member->get_features(), $select_name='features', $multiple=true); ! $tpl['CATEGORIES_LABEL'] = dgettext('rolodex', 'Category(s)'); ! $tpl['LOCATIONS_LABEL'] = dgettext('rolodex', 'Location(s)'); ! $tpl['FEATURES_LABEL'] = dgettext('rolodex', 'Feature(s)'); if (Current_User::allow('rolodex', 'edit_member')) { --- 1102,1117 ---- $tpl = $form->getTemplate(); ! if (PHPWS_Settings::get('rolodex', 'use_categories')) { ! $tpl['CATEGORIES'] = Categories::getForm($match=$member->get_categories(), $select_name='categories', $multiple=true); ! $tpl['CATEGORIES_LABEL'] = dgettext('rolodex', 'Category(s)'); ! } ! if (PHPWS_Settings::get('rolodex', 'use_locations')) { ! $tpl['LOCATIONS'] = $this->rolodex->getItemForm('location', $match=$member->get_locations(), $select_name='locations', $multiple=true); ! $tpl['LOCATIONS_LABEL'] = dgettext('rolodex', 'Location(s)'); ! } ! if (PHPWS_Settings::get('rolodex', 'use_features')) { ! $tpl['FEATURES'] = $this->rolodex->getItemForm('feature', $match=$member->get_features(), $select_name='features', $multiple=true); ! $tpl['FEATURES_LABEL'] = dgettext('rolodex', 'Feature(s)'); ! } if (Current_User::allow('rolodex', 'edit_member')) { *************** *** 1105,1109 **** $tpl['BUSINESS_LABEL'] = dgettext('rolodex', 'Business address'); $tpl['SETTINGS_GROUP_LABEL'] = dgettext('rolodex', 'Settings'); ! $tpl['SELECT_LIST_TIP'] = dgettext('rolodex', 'To use the category, location, or feature lists, select an item from the list and click on the "+" symbool to add the selection to this profile. To remove a selection, click on the name of the item in the box below the select menu.'); if (PHPWS_Settings::get('rolodex', 'custom1_name') || PHPWS_Settings::get('rolodex', 'custom2_name') || --- 1128,1134 ---- $tpl['BUSINESS_LABEL'] = dgettext('rolodex', 'Business address'); $tpl['SETTINGS_GROUP_LABEL'] = dgettext('rolodex', 'Settings'); ! if (PHPWS_Settings::get('rolodex', 'use_categories') || PHPWS_Settings::get('rolodex', 'use_locations') || PHPWS_Settings::get('rolodex', 'use_features')) { ! $tpl['SELECT_LIST_TIP'] = dgettext('rolodex', 'To use the category, location, or feature lists, select an item from the list and click on the "+" symbool to add the selection to this profile. To remove a selection, click on the name of the item in the box below the select menu.'); ! } if (PHPWS_Settings::get('rolodex', 'custom1_name') || PHPWS_Settings::get('rolodex', 'custom2_name') || Index: Rolodex.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/Rolodex.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Rolodex.php 24 Jul 2008 20:08:52 -0000 1.18 --- Rolodex.php 25 Jul 2008 12:28:15 -0000 1.19 *************** *** 784,787 **** --- 784,799 ---- } + isset($_POST['use_categories']) ? + PHPWS_Settings::set('rolodex', 'use_categories', 1) : + PHPWS_Settings::set('rolodex', 'use_categories', 0); + + isset($_POST['use_locations']) ? + PHPWS_Settings::set('rolodex', 'use_locations', 1) : + PHPWS_Settings::set('rolodex', 'use_locations', 0); + + isset($_POST['use_features']) ? + PHPWS_Settings::set('rolodex', 'use_features', 1) : + PHPWS_Settings::set('rolodex', 'use_features', 0); + if (isset($_POST['comments_enable'])) { if (isset($_POST['comments_enforce'])) { *************** *** 1551,1575 **** $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')); --- 1563,1593 ---- $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', array('uop'=>'list')); ! if (PHPWS_Settings::get('rolodex', 'use_categories')) { ! $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')); ! } } ! if (PHPWS_Settings::get('rolodex', 'use_locations')) { ! $db = new PHPWS_DB('rolodex_location'); ! $locations = $db->count(); ! if ($locations > 0) { ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Locations'), "rolodex", array('uop'=>'locations')); ! } } ! if (PHPWS_Settings::get('rolodex', 'use_features')) { ! $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')); Index: RDX_Member.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Member.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** RDX_Member.php 24 Jul 2008 12:40:18 -0000 1.16 --- RDX_Member.php 25 Jul 2008 12:28:15 -0000 1.17 *************** *** 1165,1178 **** $tpl['IMAGE'] = $this->getImage(true); ! if ($this->get_categories(true)) { $tpl['CATEGORY_LINKS'] = implode(', ', $this->get_categories(true)); $tpl['CATEGORY_LINKS_LABEL'] = dgettext('rolodex', 'Category(s)'); } ! if ($this->get_locations(true)) { $tpl['LOCATION_LINKS'] = implode(', ', $this->get_locations(true)); $tpl['LOCATION_LINKS_LABEL'] = dgettext('rolodex', 'Location(s)'); } ! if ($this->get_features(true)) { $tpl['FEATURE_LINKS'] = implode(', ', $this->get_features(true)); $tpl['FEATURE_LINKS_LABEL'] = dgettext('rolodex', 'Feature(s)'); --- 1165,1178 ---- $tpl['IMAGE'] = $this->getImage(true); ! if ($this->get_categories(true) && PHPWS_Settings::get('rolodex', 'use_categories')) { $tpl['CATEGORY_LINKS'] = implode(', ', $this->get_categories(true)); $tpl['CATEGORY_LINKS_LABEL'] = dgettext('rolodex', 'Category(s)'); } ! if ($this->get_locations(true) && PHPWS_Settings::get('rolodex', 'use_locations')) { $tpl['LOCATION_LINKS'] = implode(', ', $this->get_locations(true)); $tpl['LOCATION_LINKS_LABEL'] = dgettext('rolodex', 'Location(s)'); } ! if ($this->get_features(true) && PHPWS_Settings::get('rolodex', 'use_features')) { $tpl['FEATURE_LINKS'] = implode(', ', $this->get_features(true)); $tpl['FEATURE_LINKS_LABEL'] = dgettext('rolodex', 'Feature(s)'); *************** *** 1441,1445 **** } ! if (PHPWS_Settings::get('rolodex', 'list_categories')) { if ($this->get_categories(true)) { $tpl['CATEGORY_LINKS'] = implode(', ', $this->get_categories(true)); --- 1441,1445 ---- } ! if (PHPWS_Settings::get('rolodex', 'list_categories') && PHPWS_Settings::get('rolodex', 'use_categories')) { if ($this->get_categories(true)) { $tpl['CATEGORY_LINKS'] = implode(', ', $this->get_categories(true)); *************** *** 1448,1452 **** } ! if (PHPWS_Settings::get('rolodex', 'list_locations')) { if ($this->get_locations(true)) { $tpl['LOCATION_LINKS'] = implode(', ', $this->get_locations(true)); --- 1448,1452 ---- } ! if (PHPWS_Settings::get('rolodex', 'list_locations') && PHPWS_Settings::get('rolodex', 'use_locations')) { if ($this->get_locations(true)) { $tpl['LOCATION_LINKS'] = implode(', ', $this->get_locations(true)); *************** *** 1455,1459 **** } ! if (PHPWS_Settings::get('rolodex', 'list_features')) { if ($this->get_features(true)) { $tpl['FEATURE_LINKS'] = implode(', ', $this->get_features(true)); --- 1455,1459 ---- } ! if (PHPWS_Settings::get('rolodex', 'list_features') && PHPWS_Settings::get('rolodex', 'use_features')) { if ($this->get_features(true)) { $tpl['FEATURE_LINKS'] = implode(', ', $this->get_features(true)); |