[geeklog-cvs] Geeklog-1.x/plugins/calendar functions.inc, 1.76, 1.77

Dirk Haun dhaun at qs1489.pair.com
Sun Jan 27 10:23:35 EST 2008


Update of /cvsroot/geeklog/Geeklog-1.x/plugins/calendar
In directory qs1489.pair.com:/tmp/cvs-serv35636/plugins/calendar

Modified Files:
	functions.inc 
Log Message:
Got rid of the $_STATES array and turned the states dropdown into a simple text entry field


Index: functions.inc
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/plugins/calendar/functions.inc,v
retrieving revision 1.76
retrieving revision 1.77
diff -C2 -d -r1.76 -r1.77
*** functions.inc	29 Dec 2007 20:21:25 -0000	1.76
--- functions.inc	27 Jan 2008 15:23:32 -0000	1.77
***************
*** 11,15 ****
  // | plugin' PHP files.                                                        |
  // +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2007 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs       - tony AT tonybibbs DOT com                     |
--- 11,15 ----
  // | plugin' PHP files.                                                        |
  // +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2008 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs       - tony AT tonybibbs DOT com                     |
***************
*** 729,733 ****
      $eventform->set_var('lang_city',$LANG_CAL_1[34]);
      $eventform->set_var('lang_state',$LANG_CAL_1[35]);
!     $eventform->set_var('state_options', CALENDAR_stateList ());
      $eventform->set_var('lang_zipcode',$LANG_CAL_1[36]);
      $eventform->set_var('lang_location', $LANG_CAL_1[39]);
--- 729,733 ----
      $eventform->set_var('lang_city',$LANG_CAL_1[34]);
      $eventform->set_var('lang_state',$LANG_CAL_1[35]);
!     $eventform->set_var('state_options', '');
      $eventform->set_var('lang_zipcode',$LANG_CAL_1[36]);
      $eventform->set_var('lang_location', $LANG_CAL_1[39]);
***************
*** 1344,1348 ****
  function plugin_upgrade_calendar()
  {
!     global $_TABLES, $_CA_CONF;
  
      // the plugin needs this function so complain when it doesn't exist
--- 1344,1348 ----
  function plugin_upgrade_calendar()
  {
!     global $_TABLES, $_CA_CONF, $_STATES;
  
      // the plugin needs this function so complain when it doesn't exist
***************
*** 1351,1356 ****
      }
  
!     // no db changes - just update the version numbers
!     DB_query ("UPDATE {$_TABLES['plugins']} SET pi_version = '{$_CA_CONF['version']}', pi_gl_version = '" . VERSION . "' WHERE pi_name = 'calendar'");
  
      return true;
--- 1351,1376 ----
      }
  
!     $pi_version = DB_getItem($_TABLES['plugins'], 'pi_version',
!                              "$pi_name = 'calendar'");
! 
!     if (($pi_version == '1.0.0') || ($pi_version == '1.0.1')) {
!         DB_query("ALTER TABLE {$_TABLES['events']} CHANGE state state varchar(40) default NULL");
!         DB_query("ALTER TABLE {$_TABLES['eventsubmission']} CHANGE state state varchar(40) default NULL");
!         DB_query("ALTER TABLE {$_TABLES['personal_events']} CHANGE state state varchar(40) default NULL");
! 
!         if (isset($_STATES) && is_array($_STATES)) {
!             $tables = array($_TABLES['events'], $_TABLES['eventsubmission'],
!                             $_TABLES['personal_events']);
! 
!             foreach ($_STATES as $key => $state) {
!                 foreach ($tables as $table) {
!                     DB_change($table, 'state', addslashes($state),
!                                       'state', addslashes($key));
!                 }
!             }
!         }
!     }
! 
!     DB_query("UPDATE {$_TABLES['plugins']} SET pi_version = '{$_CA_CONF['version']}', pi_gl_version = '1.5.0' WHERE pi_name = 'calendar'");
  
      return true;
***************
*** 1652,1656 ****
                  $retval = COM_createLink(
                      $icon_arr['edit'],
!                     "{$_CONF['site_admin_url']}/plugins/calendar/index.php "
                      . "?mode=edit&eid={$A['eid']}");
              }
--- 1672,1676 ----
                  $retval = COM_createLink(
                      $icon_arr['edit'],
!                     "{$_CONF['site_admin_url']}/plugins/calendar/index.php"
                      . "?mode=edit&eid={$A['eid']}");
              }
***************
*** 1660,1664 ****
                  $retval = COM_createLink(
                      $icon_arr['copy'],
!                     "{$_CONF['site_admin_url']}/plugins/calendar/index.php "
                      . "?mode=clone&eid={$A['eid']}");
              }
--- 1680,1684 ----
                  $retval = COM_createLink(
                      $icon_arr['copy'],
!                     "{$_CONF['site_admin_url']}/plugins/calendar/index.php"
                      . "?mode=clone&eid={$A['eid']}");
              }
***************
*** 1684,1711 ****
              break;
      }
-     return $retval;
- }
- 
- /**
- * Creates a dropdown list of all the states
- *
- * @param    string  $currstate  current state (to preselect in the list)
- * @return   string              <option> list of states
- *
- */
- function CALENDAR_stateList ($currstate = '')
- {
-     global $_STATES;
- 
-     $retval = '';
- 
-     foreach ($_STATES as $statekey => $state) {
-         $retval .= '<option value="' . $statekey . '"';
-         if ($statekey == $currstate) {
-             $retval .= ' selected="selected"';
-         }
-         $retval .= '>' . $state . '</option>';
-     }
- 
      return $retval;
  }
--- 1704,1707 ----




More information about the geeklog-cvs mailing list