public
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
fix Link content type editing with ajax (some strange problem with 
dropdowns with empty value attribute when doing ajax submits, this might 
be a bigger problem with ajax on other places too)

git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@4078 
3d254a34-79dc-0310-9e5f-be208747d8a0
tsw (author)
Mon Aug 20 09:13:55 -0700 2007
commit  4339455a73bb6e123c3f585df0a6ac06efd5234f
tree    dae9c6e97d927ef89fd25efd6808003720f52804
parent  b41a269f24cb982adac962b87ddcc089cba2022a
...
52
53
54
55
 
56
57
58
 
 
 
 
 
59
60
61
...
166
167
168
169
 
170
171
172
173
 
174
175
176
...
52
53
54
 
55
56
57
58
59
60
61
62
63
64
65
66
...
171
172
173
 
174
175
176
177
 
178
179
180
181
0
@@ -52,10 +52,15 @@ class Link extends ContentBase
0
      $this->SetPropertyValue($oneparam, $params[$oneparam]);
0
     }
0
    }
0
- if (FALSE == empty($_POST['file_url']))
0
+ if ($_POST['file_url'] != "---")
0
    {
0
      $this->SetPropertyValue('url', $params['file_url']);
0
             }
0
+ # make sure target keeps empty even with the new dropdown value
0
+ if ($_POST['target'] != "---")
0
+ {
0
+ $this->SetPropertyValue('target', '');
0
+ }
0
    if (isset($params['title']))
0
    {
0
     $this->mName = $params['title'];
0
@@ -166,11 +171,11 @@ class Link extends ContentBase
0
 
0
   $ret[]= array(lang('url').':','<input type="text" name="url" size="80" value="'.cms_htmlentities($this->GetPropertyValue('url')).'" />');
0
 
0
- $text = '<option value="">'.lang('no_file_url').'</option>';
0
+ $text = '<option value="---">'.lang('no_file_url').'</option>';
0
   $text .= $this->directoryToSelect($gCms->config['uploads_path'], true, $gCms->config['uploads_path'], $this->GetPropertyValue('url'));
0
   $ret[]= array(lang('file_url').':','<select name="file_url">'.$text.'</select>');
0
   
0
- $text = '<option value="">'.lang('none').'</option>';
0
+ $text = '<option value="---">'.lang('none').'</option>';
0
   $text .= '<option value="_blank"'.($this->GetPropertyValue('target')=='_blank'?' selected="selected"':'').'>_blank</option>';
0
   $text .= '<option value="_parent"'.($this->GetPropertyValue('target')=='_parent'?' selected="selected"':'').'>_parent</option>';
0
   $text .= '<option value="_self"'.($this->GetPropertyValue('target')=='_self'?' selected="selected"':'').'>_self</option>';

Comments

    No one has commented yet.