Skip to content
Snippets Groups Projects
Commit 1f6d4d02 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

rel #23826: Class_Onglet format

parent 876c074f
Branches
Tags
3 merge requests!903Master,!902Hotline master,!901Hotline#23826 bad record album link
......@@ -22,75 +22,85 @@
class Class_Onglet {
use Trait_Singleton, Trait_Translator;
protected $libelle;
protected $function_name='alwaysDisplay';
// Mode d'affichage 0=aucun 1=bloc déplié 2=bloc fermé 3=dans 1 onglet
protected $function_name = 'alwaysDisplay';
/** Mode d'affichage 0=aucun 1=bloc déplié 2=bloc fermé 3=dans 1 onglet */
protected $display=0;
protected $largeur=0; // Largeur de l'onglet 0=répartition auto en pourcentage
/** Largeur de l'onglet 0=répartition auto en pourcentage */
protected $largeur=0;
protected $order=0;
public static function forLibelleAndType($libelle,$type) {
return new self($libelle,$type);
public static function forLibelleAndType($libelle, $type) {
return new self($libelle, $type);
}
public function __construct($libelle,$type) {
public function __construct($libelle, $type) {
$this->setLibelle($libelle);
$this->setType($type);
return $this;
}
function setLibelle($libelle) {
$this->libelle=$libelle;
public function setLibelle($libelle) {
$this->libelle = $libelle;
return $this;
}
function getLibelle() {
public function getLibelle() {
return $this->libelle;
}
function setType($type) {
$this->type=$type;
public function setType($type) {
$this->type = $type;
return $this;
}
function getType() {
public function getType() {
return $this->type;
}
function setLargeur($largeur) {
$this->largeur=$largeur;
public function setLargeur($largeur) {
$this->largeur = $largeur;
return $this;
}
function getLargeur() {
public function getLargeur() {
return $this->largeur;
}
function setDisplayMethod($function_name) {
$this->function_name=$function_name;
public function setDisplayMethod($function_name) {
$this->function_name = $function_name;
return $this;
}
function callDisplayMethod($param) {
public function callDisplayMethod($param) {
return ($this->{$this->function_name}($param));
}
function alwaysDisplay($param) {
public function alwaysDisplay($param) {
return true;
}
function checkIfClefChapeauExists($notice) {
public function checkIfClefChapeauExists($notice) {
return strlen($notice->getClefChapeau())>0;
}
function checkIfHasRessourcesNumeriques($notice) {
public function checkIfHasRessourcesNumeriques($notice) {
if (1 == Class_AdminVar::isBibNumEnabled()
&& Class_Users::isCurrentUserAdmin())
return true;
......@@ -100,31 +110,31 @@ class Class_Onglet {
}
function checkIfHasNoticesLiees($notice) {
public function checkIfHasNoticesLiees($notice) {
$sourceLinks = $notice->getLinksAsSource();
$targetLinks = $notice->getLinksAsTarget();
return !(0 == count($sourceLinks) and 0 == count($targetLinks));
}
function setDisplayMode($display) {
$this->display=$display;
public function setDisplayMode($display) {
$this->display = $display;
return $this;
}
function getDisplayMode() {
public function getDisplayMode() {
return $this->display;
}
function getOrder() {
public function getOrder() {
return $this->order;
}
function setOrder($order) {
$this->order=$order;
public function setOrder($order) {
$this->order = $order;
return $this;
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment