Beispiel #1
0
   	if (is_array($system_pages))
       while (list($type,$pages) = each ($system_pages)) {
         foreach ($pages as $page)
           Sql_Query(sprintf('insert into %s (page,type) values("%s","%s")',
             $tables["task"],$page,$type));
       }
     # make sure all users have a uniqid
     $req = Sql_Query("select id from {$tables["user"]} where uniqid = \"\"");
     print "<br>Giving every user a unique ID<br />";
     flush();
     $num = Sql_Affected_Rows();
     print "$num to process<br/>";
     $c =0;
     while ($user = Sql_Fetch_Row($req)) {
       $c++;
       Sql_Query(sprintf('update %s set uniqid = "%s" where id = %d',$tables["user"],getUniqId(),$user[0]));
       if ($c % 15 == 0) {
         print $c . "<br/>";
         flush();
       }
     }
     print "<p>All done";
     break;
 }
 print '<script language="Javascript" type="text/javascript"> finish(); </script>';
 # update the system pages
 while (list($type,$pages) = each ($system_pages)) {
   foreach ($pages as $page)
     Sql_Query(sprintf('replace into %s (page,type) values("%s","%s")',
       $tables["task"],$page,$type));
 }
Beispiel #2
0
 function __toString()
 {
     $param = array();
     foreach ($this->param as $key => $value) {
         $param[] = "{$key}={$value}";
     }
     $urlparam = implode("&", $param);
     if ($this->origText == '') {
         $this->origText = "n/a";
     }
     $idx = getUniqId();
     $str = '';
     $str .= "<span id=\"id{$idx}\" class=\"editinplace\">" . $this->origText . "</span>";
     /* $str .= '<script type="text/javascript">';
        $str .= "     new Ajax.InPlaceEditor($('id$idx'),'".$this->url."', {\n
        okButton: true, cancelLink: true, cancelText : '"._('Cancel')."',
        highlightcolor : '#FF9966',
        ajaxOptions: {method: 'get' },\n
        callback: function(form,value) {\n
        return '$urlparam&value='+value\n
        }\n
        });\n
        </script>\n"; ===> CLASS NOT USED */
     return $str;
 }