projects
/
mw_sourceml
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
titre du site par defaut
[mw_sourceml]
/
app
/
data
/
modules
/
sql
/
sml_data_licences.php
diff --git
a/app/data/modules/sql/sml_data_licences.php
b/app/data/modules/sql/sml_data_licences.php
index
90445bb
..
53f96a3
100644
(file)
--- a/
app/data/modules/sql/sml_data_licences.php
+++ b/
app/data/modules/sql/sml_data_licences.php
@@
-2,7
+2,7
@@
class sml_data_licences extends mw_data{
class sml_data_licences extends mw_data{
- function licences($start = null){
+
public
function licences($start = null){
$sgbd = $this->sgbd();
$env = $this->env();
$licences = array("list" => array(), "total" => 0);
$sgbd = $this->sgbd();
$env = $this->env();
$licences = array("list" => array(), "total" => 0);
@@
-22,11
+22,13
@@
$sgbd->free_result($rst);
}
}
$sgbd->free_result($rst);
}
}
- catch(Exception $e) { $licences = false; }
+ catch(Exception $e){
+ $licences = false;
+ }
return $licences;
}
return $licences;
}
- function licence($id){
+
public
function licence($id){
$sgbd = $this->sgbd();
$licence = array();
try{
$sgbd = $this->sgbd();
$licence = array();
try{
@@
-35,11
+37,13
@@
if($v_rst = $sgbd->fetch_assoc($rst)) $licence = $v_rst;
$sgbd->free_result($rst);
}
if($v_rst = $sgbd->fetch_assoc($rst)) $licence = $v_rst;
$sgbd->free_result($rst);
}
- catch(Exception $e) { $licence = false; }
+ catch(Exception $e){
+ $licence = false;
+ }
return $licence;
}
return $licence;
}
- function add_licence($nom, $url){
+
public
function add_licence($nom, $url){
$sgbd = $this->sgbd();
try{
$sql =
$sgbd = $this->sgbd();
try{
$sql =
@@
-49,11
+53,13
@@
.")";
$sgbd->query($sql);
}
.")";
$sgbd->query($sql);
}
- catch(Exception $e) { return false; }
+ catch(Exception $e){
+ return false;
+ }
return true;
}
return true;
}
- function set_licence($id, $nom, $url){
+
public
function set_licence($id, $nom, $url){
if(($licence = $this->licence($id)) !== false){
$sgbd = $this->sgbd();
try{
if(($licence = $this->licence($id)) !== false){
$sgbd = $this->sgbd();
try{
@@
-69,13
+75,15
@@
if(!$this->maj_source_xml_licence($licence)) return false;
}
}
if(!$this->maj_source_xml_licence($licence)) return false;
}
}
- catch(Exception $e) { return false; }
+ catch(Exception $e){
+ return false;
+ }
return true;
}
return false;
}
return true;
}
return false;
}
- function del_licence($id){
+
public
function del_licence($id){
$sgbd = $this->sgbd();
try{
$sql = "SELECT count(*) as n FROM #--sml_sources WHERE licence=".$this->eq($id);
$sgbd = $this->sgbd();
try{
$sql = "SELECT count(*) as n FROM #--sml_sources WHERE licence=".$this->eq($id);
@@
-86,10
+94,10
@@
$sql = "DELETE FROM #--sml_licences WHERE id=".$this->eq($id);
$sgbd->query($sql);
}
$sql = "DELETE FROM #--sml_licences WHERE id=".$this->eq($id);
$sgbd->query($sql);
}
- catch(Exception $e) { return false; }
+ catch(Exception $e){
+ return false;
+ }
return true;
}
}
return true;
}
}
-
-?>
\ No newline at end of file