~jernej-novak/slowtool/slownetBranch

« back to all changes in this revision

Viewing changes to system/application/controllers/edit.php

  • Committer: Jernej Novak
  • Date: 2012-02-22 16:07:57 UTC
  • Revision ID: jernej.novak@gmail.com-20120222160757-pzmid8onhip523io
Bug fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
                $this->load->library('firephp');
11
11
                $this->load->helper('url');
12
12
    }
 
13
    
 
14
    function SetApproved($id, $status)
 
15
    {
 
16
        if($this->auth->CheckUserCredentials(CAN_APPROVE))
 
17
        {
 
18
                $this->editmodel->SetApproved($id, ($status == 1) ? APPROVED : 0, $this->auth->UserId());
 
19
                echo json_encode(array("success" => true));
 
20
        }
 
21
        else
 
22
        {
 
23
                echo json_encode(array("success" => false, "message" => "Access denied!"));     
 
24
        }
 
25
    }
13
26
        
14
27
        function InsertLiteral($synsetId)
15
28
        {
63
76
                        echo json_encode(array("success" => false, "message" => "Access denied!"));     
64
77
                }
65
78
        }
 
79
        
 
80
        function EditDefinitions($definitionId, $synsetId)
 
81
        {
 
82
                if($this->auth->CheckUserCredentials(CAN_EDIT_DEFINITIONS))
 
83
                {
 
84
                        if(strlen($this->input->post('text'))> 0)
 
85
                        {
 
86
                                $this->editmodel->EditDefinition($definitionId, $synsetId, $this->input->post('text'), $_SESSION['User']->UserId);
 
87
                                echo json_encode(array("success" => true, "message" => ""));
 
88
                        }
 
89
                        else 
 
90
                        {
 
91
                                echo json_encode(array("success" => false, "message" => "Empty literal not valid!"));
 
92
                        }       
 
93
                }
 
94
                else
 
95
                {
 
96
                        echo json_encode(array("success" => false, "message" => "Access denied!"));     
 
97
                }
 
98
        }
66
99
}
67
100
 
68
101
?>
 
 
b'\\ No newline at end of file'