[Hastymail-cvs] SF.net SVN: hastymail:[1577] trunk/hastymail2/lib/site_page_class.php
Brought to you by:
sailfrog,
slushpupie
From: <sai...@us...> - 2010-06-18 15:38:03
|
Revision: 1577 http://hastymail.svn.sourceforge.net/hastymail/?rev=1577&view=rev Author: sailfrog Date: 2010-06-18 15:37:57 +0000 (Fri, 18 Jun 2010) Log Message: ----------- fix a browser bug that allows select boxes to default to disabled options elements (chrome) Modified Paths: -------------- trunk/hastymail2/lib/site_page_class.php Modified: trunk/hastymail2/lib/site_page_class.php =================================================================== --- trunk/hastymail2/lib/site_page_class.php 2010-06-15 20:47:25 UTC (rev 1576) +++ trunk/hastymail2/lib/site_page_class.php 2010-06-18 15:37:57 UTC (rev 1577) @@ -424,10 +424,29 @@ $this->print_folder_option_list($this->pd['folders'], false, 0, array($this->pd['current_destination']), true, true).'</select>'; return $data; } +function prep_selected($folders, $selected, $no_current) { + if (!empty($selected) && $selected[0]) { + return $selected; + } + else { + foreach ($folders as $name => $vals) { + if ($no_current && $this->pd['mailbox'] == $name) { + continue; + } + if (!$vals['noselect']) { + return array($name); + } + } + } + return array(); +} function print_folder_option_list($folders, $parent=false, $i=0, $selected=array(), $clean=false, $no_current=false, $selectable_type='selectable', $exclude_list=array(), $ignore_parents=false) { $data = ''; global $used; global $conf; + if ($i == 0) { + $selected = $this->prep_selected($folders, $selected, $no_current); + } if ($this->pd['settings']['folder_style'] == 1) { $pre = str_repeat(' ', ($i*5)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |