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
Search Repo:
Added params array to CreateFormStart

git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@2743 
3d254a34-79dc-0310-9e5f-be208747d8a0
tedkulp (author)
Sun May 07 20:00:00 -0700 2006
commit  b124044c4a8d5f45aed924b8953a74347a7ed639
tree    91c734584bb4803329592ae2d48150c0b2669740
parent  911a430fd01817a7f7709cd8b98f682ddf7de318
...
163
164
165
166
 
167
168
169
...
180
181
182
183
 
184
185
186
...
163
164
165
 
166
167
168
169
...
180
181
182
 
183
184
185
186
0
@@ -163,7 +163,7 @@
0
 $query = "SELECT user_id, username FROM ".cms_db_prefix()."users ORDER BY username";
0
 $result = $db->Execute($query);
0
 
0
-while($r$row = $result->FetchRow())
0
+while($result && $row = $result->FetchRow())
0
 {
0
   $owners .= "<option value=\"".$row["user_id"]."\"";
0
   if ($row["user_id"] == $owner_id)
0
@@ -180,7 +180,7 @@
0
 $query = "SELECT user_id, username FROM ".cms_db_prefix()."users WHERE user_id <> ? ORDER BY username";
0
 $result = $db->Execute($query,array($userid));
0
 
0
-while($r$row = $result->FetchRow())
0
+while($result && $row = $result->FetchRow())
0
 {
0
   $addt_users .= "<option value=\"".$row["user_id"]."\"";
0
   $query = "SELECT * from ".cms_db_prefix()."additional_htmlblob_users WHERE user_id = ".$row["user_id"]." AND htmlblob_id = ?";
...
206
207
208
209
 
210
211
212
213
214
 
215
216
217
...
206
207
208
 
209
210
 
 
 
 
211
212
213
214
0
@@ -206,12 +206,9 @@
0
       AND    assoc_type  = 'template'
0
       AND    assoc_to_id = ?";
0
     $cssresult = $db->Execute($cssquery,array($template_id));
0
- if ($cssresult && $cssresult->RowCount() > 0)
0
+ while ($cssresult && $cssline = $cssresult->FetchRow())
0
     {
0
- while ($cssline = $cssresult->FetchRow())
0
- {
0
- $data["stylesheet"] .= "\n".$cssline['css_text']."\n";
0
- }
0
+ $data["stylesheet"] .= "\n".$cssline['css_text']."\n";
0
     }
0
 
0
     $tmpfname = '';
...
240
241
242
243
244
245
246
247
248
 
 
 
249
250
251
...
240
241
242
 
243
 
 
 
 
244
245
246
247
248
249
0
@@ -240,12 +240,10 @@
0
 }
0
 
0
 #First do dirs
0
-$ls = dir($dir);
0
 $dirs = array();
0
-while (($file = $ls->read()) != "")
0
-{
0
- array_push($dirs, $file);
0
-}
0
+$handle = opendir($dir);
0
+while (false!==($file = readdir($handle))) $dirs[]=$file;
0
+closedir($handle);
0
 sort($dirs);
0
 foreach ($dirs as $file)
0
 {
...
29
30
31
32
33
 
 
 
34
35
36
37
 
38
39
40
...
29
30
31
 
 
32
33
34
35
36
37
38
39
40
41
42
0
@@ -29,12 +29,14 @@
0
 
0
   #Read in all current languages...
0
   $dir = dirname(__FILE__)."/lang";
0
- $ls = dir($dir);
0
- while (($file = $ls->read()) != "") {
0
+
0
+ $handle = opendir($dir);
0
+ while (false!==($file = readdir($handle))) {
0
     if (is_file("$dir/$file") && strpos($file, "nls.php") != 0) {
0
       include("$dir/$file");
0
     }
0
   }
0
+ closedir($handle);
0
 
0
   #Check to see if there is already a language in use...
0
   if (isset($_POST["default_cms_lang"]))
...
2335
2336
2337
2338
 
2339
2340
2341
...
2335
2336
2337
 
2338
2339
2340
2341
0
@@ -2335,7 +2335,7 @@
0
     global $gCms;
0
     $db = &$gCms->GetDb();
0
 
0
- if (!is_numeric($alias) && strpos($alias,'.') == TRUE && strpos($alias,',') == TRUE)
0
+ if (!is_numeric($id) && strpos($id,'.') == TRUE && strpos($id,',') == TRUE)
0
     {
0
       return $id;
0
     }
...
1819
1820
1821
 
1822
1823
1824
 
1825
1826
 
1827
1828
1829
1830
...
1837
1838
1839
 
1840
1841
 
1842
1843
1844
...
1880
1881
1882
 
 
 
 
 
1883
1884
1885
...
1819
1820
1821
1822
1823
1824
 
1825
1826
 
1827
1828
1829
1830
1831
...
1838
1839
1840
1841
1842
 
1843
1844
1845
1846
...
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
0
@@ -1819,11 +1819,12 @@
0
    * @param string Optional enctype to use, Good for situations where files are being uploaded
0
    * @param boolean A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
0
    * @param string Text to append to the end of the id and name of the form
0
+ * @param array Extra parameters to pass along when the form is submitted
0
    */
0
   function CreateFrontendFormStart($id,$returnid,$action='default',$method='post',
0
- $enctype='',$inline=true,$idsuffix='')
0
+ $enctype='',$inline=true,$idsuffix='',$params=array())
0
   {
0
- return $this->CreateFormStart($id,$action,$returnid,$method,$post,$enctype,$inline,$idsuffix);
0
+ return $this->CreateFormStart($id,$action,$returnid,$method,$post,$enctype,$inline,$idsuffix,$params);
0
   }
0
 
0
 
0
0
@@ -1837,8 +1838,9 @@
0
    * @param string Optional enctype to use, Good for situations where files are being uploaded
0
    * @param boolean A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
0
    * @param string Text to append to the end of the id and name of the form
0
+ * @param array Extra parameters to pass along when the form is submitted
0
    */
0
- function CreateFormStart($id, $action='default', $returnid='', $method='post', $enctype='', $inline=false, $idsuffix='')
0
+ function CreateFormStart($id, $action='default', $returnid='', $method='post', $enctype='', $inline=false, $idsuffix='', $params = array())
0
   {
0
     global $gCms;
0
 
0
@@ -1880,6 +1882,11 @@
0
       {
0
         $text .= '<input type="hidden" name="'.$this->cms->config['query_var'].'" value="'.$returnid.'" />';
0
       }
0
+ }
0
+ foreach ($params as $key=>$value)
0
+ {
0
+ if ($key != 'module' && $key != 'action' && $key != 'id')
0
+ $text .= '<input type="hidden" name="'.$id.$key.'" value="'.$value.'" />';
0
     }
0
     $text .= "</div>\n";
0
 

Comments

    No one has commented yet.