new coding convention , Change File name : class_ becomes file.class.php
This commit is contained in:
parent
1d5550713f
commit
f84a96033e
355 changed files with 1011 additions and 1011 deletions
59
include/class/menu_ref.class.php
Normal file
59
include/class/menu_ref.class.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
/*
|
||||
* This file is part of NOALYSS.
|
||||
*
|
||||
* NOALYSS is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* NOALYSS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with NOALYSS; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
// Copyright Author Dany De Bontridder danydb@aevalys.eu
|
||||
/**
|
||||
*@file
|
||||
*@brief Menu_Ref let you manage the available menu
|
||||
*/
|
||||
require_once NOALYSS_INCLUDE.'/database/menu_ref_sql.class.php';
|
||||
class Menu_Ref extends Menu_Ref_sql
|
||||
{
|
||||
function format_code()
|
||||
{
|
||||
$this->me_code=strtoupper($this->me_code);
|
||||
$this->me_code=trim($this->me_code);
|
||||
$this->me_code=str_replace('<','',$this->me_code);
|
||||
$this->me_code=str_replace('>','',$this->me_code);
|
||||
}
|
||||
function verify()
|
||||
{
|
||||
try
|
||||
{
|
||||
parent::verify();
|
||||
if ( $this->me_code == -1)
|
||||
{
|
||||
$this->format_code();
|
||||
if ( $this->cn->get_value("select count(*) from menu_ref where me_code=$1",array($this->me_code)) > 0)
|
||||
throw new Exception ('Doublon');
|
||||
if (trim($this->me_code)=='')
|
||||
throw new Exception ('Ce menu existe déjà');
|
||||
}
|
||||
if ( ! file_exists('../include/'.$this->me_file)) throw new Exception ('Ce menu fichier '.$this->me_file." n'existe pas");
|
||||
|
||||
return 0;
|
||||
} catch (Exception $e)
|
||||
{
|
||||
alert($e->getMessage());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue