[geeklog-cvs] Geeklog-1.x/system/classes config.class.php,1.1,1.2

Aaron Blankstein ablankstein at qs1489.pair.com
Sun Sep 2 22:25:21 EDT 2007


Update of /cvsroot/geeklog/Geeklog-1.x/system/classes
In directory qs1489.pair.com:/tmp/cvs-serv37387/system/classes

Modified Files:
	config.class.php 
Log Message:
Added localization support to configuration UI, changed defaults of some config values to be 
commented out, and modified the install process for config parameters.



Index: config.class.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/classes/config.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** config.class.php	29 Aug 2007 03:25:12 -0000	1.1
--- config.class.php	3 Sep 2007 02:25:19 -0000	1.2
***************
*** 185,207 ****
       * @param boolean $set              whether or not this parameter is set
       */
!     function add($param_name, $default_value, $display_name,
!                         $type, $subgroup, $fieldset, $selection_array=null,
!                         $sort=0, $set=true)
      {
          global $_TABLES, $_DB, $_DB_dbms;
!         $format = 'INSERT INTO %1$s (name, value, display_name, type, ' .
!             'default_value, subgroup, group_name, selectionArray, sort_order,'.
!             ' fieldset) ' .
!             'VALUES ("%2$s","%3$s","%4$s","%5$s","%11$s","%6$s","%7$s",'. 
!             '"%8$s",%9$s, "%10$s")';
          $Qargs = array($_TABLES['conf_values'], 
                         $param_name,
                         $set ? serialize($default_value) : 'unset', 
-                        $display_name, 
                         $type, 
                         $subgroup,
                         $this->ref, 
                         ($selection_array === null ? 
!                         null : serialize($selection_array)),
                         $sort, 
                         $fieldset,
--- 185,205 ----
       * @param boolean $set              whether or not this parameter is set
       */
!     function add($param_name, $default_value, $type, $subgroup, $fieldset, 
! 		 $selection_array=null, $sort=0, $set=true)
      {
          global $_TABLES, $_DB, $_DB_dbms;
!         $format = 'INSERT INTO %1$s (name, value, type, ' .
!             'subgroup, group_name, selectionArray, sort_order,'.
!             ' fieldset, default_value) ' .
!             'VALUES ("%2$s","%3$s","%4$s",%5$s,"%6$s",%7$s,'. 
!             '%8$s,%9$s, "%10$s")';
          $Qargs = array($_TABLES['conf_values'], 
                         $param_name,
                         $set ? serialize($default_value) : 'unset', 
                         $type, 
                         $subgroup,
                         $this->ref, 
                         ($selection_array === null ? 
!                         -1 : $selection_array),
                         $sort, 
                         $fieldset,
***************
*** 237,242 ****
      function _get_extended($subgroup)
      {
!         global $_TABLES;
!         $q_string = "SELECT name, display_name, type, selectionArray, " 
              . "fieldset, value FROM {$_TABLES['conf_values']}" . 
              " WHERE group_name='{$this->ref}' and subgroup='{$subgroup}' " . 
--- 235,240 ----
      function _get_extended($subgroup)
      {
!         global $_TABLES, $LANG_coreconfignames, $LANG_coreconfigselects;
!         $q_string = "SELECT name, type, selectionArray, " 
              . "fieldset, value FROM {$_TABLES['conf_values']}" . 
              " WHERE group_name='{$this->ref}' and subgroup='{$subgroup}' " . 
***************
*** 246,261 ****
          while ($row = DB_fetchArray($Qresult)) {
              $cur = $row;
!             $res[$cur[4]][$cur[0]] = 
!                 array('display_name' => $cur[1],
                        'type' => 
!                       (($cur[5] == 'unset') ?
!                        'unset' : $cur[2]),
                        'selectionArray' => 
! 		      (($cur[3] != null) ?
! 		       unserialize($cur[3]) : null),
                        'value' => 
!                       (($cur[5] == 'unset') ?
!                        'unset' : unserialize($cur[5])));
! 	}
          return $res;
      }
--- 244,262 ----
          while ($row = DB_fetchArray($Qresult)) {
              $cur = $row;
!             $res[$cur[3]][$cur[0]] = 
!                 array('display_name' => 
!                       (array_key_exists($cur[0], $LANG_coreconfignames) ?
!                        $LANG_coreconfignames[$cur[0]]
!                        : $cur[0]),
                        'type' => 
!                       (($cur[4] == 'unset') ?
!                        'unset' : $cur[1]),
                        'selectionArray' => 
!                       (($cur[2] != -1) ?
!                        $LANG_coreconfigselects[$cur[2]] : null),
                        'value' => 
!                       (($cur[4] == 'unset') ?
!                        'unset' : unserialize($cur[4])));
!         }
          return $res;
      }
***************
*** 281,285 ****
          $return = array();
          while ($row = DB_fetchArray($res))
!             $return[] = stripslashes($row[0]);
          return $return;
      }
--- 282,286 ----
          $return = array();
          while ($row = DB_fetchArray($res))
!             $return[] = $row[0];
          return $return;
      }
***************
*** 297,302 ****
  	 */
  	
!     function get_ui($sg=null, $change_result=null)
      {
          if (!SEC_inGroup('Root'))
              return config::_UI_perm_denied();
--- 298,304 ----
  	 */
  	
!     function get_ui($sg=0, $change_result=null)
      {
+         global $LANG_coreconfigsubgroups;
          if (!SEC_inGroup('Root'))
              return config::_UI_perm_denied();
***************
*** 316,324 ****
          $t->set_block('main','subgroup-selector','navbar');
          foreach ($subgroups as $sgroup) {
-             if ($sg == null)
-                 $sg = $sgroup;
              $t->set_var('select_id', ($sg === $sgroup ? 'id="current"' : ''));
              $t->set_var('subgroup_name', $sgroup);
!             $t->set_var("subgroup_display_name", str_replace("_", " ", $sgroup));
              $t->parse("navbar", "subgroup-selector", true);
          }
--- 318,325 ----
          $t->set_block('main','subgroup-selector','navbar');
          foreach ($subgroups as $sgroup) {
              $t->set_var('select_id', ($sg === $sgroup ? 'id="current"' : ''));
              $t->set_var('subgroup_name', $sgroup);
!             $t->set_var("subgroup_display_name", 
!                         $LANG_coreconfigsubgroups[$sgroup]);
              $t->parse("navbar", "subgroup-selector", true);
          }
***************
*** 363,370 ****
      }
  
!     function _UI_get_fs($contents, $name, &$t)
      {
          $t->set_var('fs_contents', $contents);
!         $t->set_var('fs_display', str_replace('_', ' ', $name));
          $t->set_var('fs_notes', '');
          $t->parse('sg_contents', 'fieldset', true);
--- 364,372 ----
      }
  
!     function _UI_get_fs($contents, $fs_id, &$t)
      {
+         global $LANG_fs;
          $t->set_var('fs_contents', $contents);
!         $t->set_var('fs_display', $LANG_fs[$fs_id]);
          $t->set_var('fs_notes', '');
          $t->parse('sg_contents', 'fieldset', true);




More information about the geeklog-cvs mailing list