[SPIP] +2.1.12
[velocampus/web/www.git] / www / plugins / auto / couteau_suisse / couteau_suisse / outils / orientation_fonctions.php
diff --git a/www/plugins/auto/couteau_suisse/couteau_suisse/outils/orientation_fonctions.php b/www/plugins/auto/couteau_suisse/couteau_suisse/outils/orientation_fonctions.php
new file mode 100644 (file)
index 0000000..8d7f6db
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+
+// {portrait}
+function critere_portrait($idb, &$boucles, $crit) {
+       $boucle = &$boucles[$idb];
+       $table = $boucle->id_table;
+       $boucle->where[] = $crit->not
+               ?"'($table.largeur>0 AND $table.hauteur <= $table.largeur)'"
+               :"'($table.largeur>0 AND $table.hauteur > $table.largeur)'";
+}
+
+// {paysage}
+function critere_paysage($idb, &$boucles, $crit) {
+       $boucle = &$boucles[$idb];
+       $table = $boucle->id_table;
+       $boucle->where[] = $crit->not
+               ?"'($table.largeur>0 AND $table.largeur <= $table.hauteur)'"
+               :"'($table.largeur>0 AND $table.largeur > $table.hauteur)'";
+}
+
+// {carre}
+function critere_carre($idb, &$boucles, $crit) {
+       $boucle = &$boucles[$idb];
+       $table = $boucle->id_table;
+       $boucle->where[] = $crit->not
+               ?"'($table.largeur != $table.hauteur)'"
+               :"'($table.largeur>0 AND $table.largeur = $table.hauteur)'";
+}
+
+?>
\ No newline at end of file