Show
Ignore:
Timestamp:
04/29/05 14:21:46 (7 years ago)
Author:
fproulx
Message:

2005-04-29 Fran�ois Proulx <francois.proulx@…>

  • Removed all inline unuseful javascript code on submit buttons onclick='submit()'
  • This conflicted with the actual click on the submit button in Safari
  • Fixed check in Network for isOwner, only check superAdmin
  • Fixed bug so you can't add an existing content group to itself ( deadlock )
  • Started coding Pattern language narrative display
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/classes/Content.php

    r600 r601  
    172172                        $value = _("Add"); 
    173173                } 
    174                 $html .= "<input type='submit' name='$name' value='$value'>"; // onclick='submit();' 
     174                $html .= "<input type='submit' name='$name' value='$value'>"; 
    175175                return $html; 
    176176        } 
     
    378378        public function isDisplayableAt($node) 
    379379        { 
    380  
    381380                return true; 
    382381        } 
     
    598597                                        $html .= "<div class='admin_section_tools'>\n"; 
    599598                                        $name = "content_".$this->id."_title_erase"; 
    600                                         $html .= "<input type='submit' name='$name' value='"._("Delete")."' onclick='submit();'>"; 
     599                                        $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; 
    601600                                        $html .= "</div>\n"; 
    602601                                } 
     
    629628                                        $html .= "<div class='admin_section_tools'>\n"; 
    630629                                        $name = "content_".$this->id."_description_erase"; 
    631                                         $html .= "<input type='submit' name='$name' value='"._("Delete")."' onclick='submit();'>"; 
     630                                        $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; 
    632631                                        $html .= "</div>\n"; 
    633632                                } 
     
    650649                                        $html .= "<div class='admin_section_tools'>\n"; 
    651650                                        $name = "content_".$this->id."_project_info_erase"; 
    652                                         $html .= "<input type='submit' name='$name' value='"._("Delete")."' onclick='submit();'>"; 
     651                                        $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; 
    653652                                        $html .= "</div>\n"; 
    654653                                } 
     
    671670                                        $html .= "<div class='admin_section_tools'>\n"; 
    672671                                        $name = "content_".$this->id."_sponsor_info_erase"; 
    673                                         $html .= "<input type='submit' name='$name' value='"._("Delete")."' onclick='submit();'>"; 
     672                                        $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; 
    674673                                        $html .= "</div>\n"; 
    675674                                } 
     
    701700                                                $html .= "<div class='admin_section_tools'>\n"; 
    702701                                                $name = "content_".$this->id."_owner_".$user->GetId()."_remove"; 
    703                                                 $html .= "<input type='submit' name='$name' value='"._("Remove")."' onclick='submit();'>"; 
     702                                                $html .= "<input type='submit' name='$name' value='"._("Remove")."'>"; 
    704703                                                $html .= "</div>\n"; 
    705704                                                $html .= "</li>\n"; 
     
    714713                                $name = "content_{$this->id}_add_owner_submit"; 
    715714                                $value = _("Add owner"); 
    716                                 $html .= "<input type='submit' name='$name' value='$value' onclick='submit();'>"; 
     715                                $html .= "<input type='submit' name='$name' value='$value'>"; 
    717716                                $html .= "</div>\n"; 
    718717                                $html .= "</li>\n"; 
     
    757756                                        { 
    758757                                                $db->ExecSqlUpdate("UPDATE content SET title = NULL WHERE content_id = '$this->id'", FALSE); 
    759                                                 $title->delete(); 
     758                                                $title->delete($errmsg); 
    760759                                        } 
    761760                                        else 
     
    786785                                        { 
    787786                                                $db->ExecSqlUpdate("UPDATE content SET description = NULL WHERE content_id = '$this->id'", FALSE); 
    788                                                 $description->delete(); 
     787                                                $description->delete($errmsg); 
    789788                                        } 
    790789                                        else 
     
    811810                                        { 
    812811                                                $db->ExecSqlUpdate("UPDATE content SET project_info = NULL WHERE content_id = '$this->id'", FALSE); 
    813                                                 $project_info->delete(); 
     812                                                $project_info->delete($errmsg); 
    814813                                        } 
    815814                                        else 
     
    836835                                        { 
    837836                                                $db->ExecSqlUpdate("UPDATE content SET sponsor_info = NULL WHERE content_id = '$this->id'", FALSE); 
    838                                                 $sponsor_info->delete(); 
     837                                                $sponsor_info->delete($errmsg); 
    839838                                        } 
    840839                                        else 
     
    888887        } 
    889888        } 
     889     
     890    /** 
     891     * Tell if a given user is already subscribed to this content 
     892     * @param User the given user 
     893     * @return boolean 
     894     */ 
     895    public function isUserSubscribed(User $user) 
     896    { 
     897        global $db; 
     898        $sql = "SELECT content_id FROM user_has_content WHERE user_id = '{$user->getId()}' AND content_id = '{$this->getId()}';"; 
     899        $db->ExecSqlUniqueRes($sql, $row, false); 
     900         
     901        if($row) 
     902            return true; 
     903        else 
     904            return false; 
     905    } 
     906     
    890907        /** Subscribe to the project  
    891908         * @return true on success, false on failure */