Subversion Repositories Applications.papyrus

Rev

Rev 1109 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1109 Rev 1110
Line 19... Line 19...
19
// |                                                                                                      |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: gallerie.php,v 1.1 2006-12-07 15:39:47 jp_milcent Exp $
24
// CVS : $Id: gallerie.php,v 1.2 2006-12-07 16:25:23 jp_milcent Exp $
25
/**
25
/**
26
* papyrus_bp - gallerie.php
26
* papyrus_bp - gallerie.php
27
*
27
*
28
* Le code provient de "Simple Image Gallery" (in content items) Plugin for Joomla 1.0.x - Version 1.0
28
* Le code provient de "Simple Image Gallery" (in content items) Plugin for Joomla 1.0.x - Version 1.0
29
* License: http://www.gnu.org/copyleft/gpl.html
29
* License: http://www.gnu.org/copyleft/gpl.html
Line 35... Line 35...
35
//Auteur original :
35
//Auteur original :
36
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
36
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
37
//Autres auteurs :
37
//Autres auteurs :
38
*@author        Aucun
38
*@author        Aucun
39
*@copyright     Tela-Botanica 1999-2006
39
*@copyright     Tela-Botanica 1999-2006
40
*@version       $Revision: 1.1 $ $Date: 2006-12-07 15:39:47 $
40
*@version       $Revision: 1.2 $ $Date: 2006-12-07 16:25:23 $
41
// +------------------------------------------------------------------------------------------------------+
41
// +------------------------------------------------------------------------------------------------------+
42
*/
42
*/
Line 43... Line 43...
43
 
43
 
44
// +------------------------------------------------------------------------------------------------------+
44
// +------------------------------------------------------------------------------------------------------+
Line 73... Line 73...
73
	    $tab_parametres = explode('=', trim($argument));
73
	    $tab_parametres = explode('=', trim($argument));
74
	    $options[$tab_parametres[0]] = trim($tab_parametres[1], '"'); 
74
	    $options[$tab_parametres[0]] = trim($tab_parametres[1], '"'); 
75
    }
75
    }
Line 76... Line 76...
76
    
76
    
77
    if (!isset($options['dossier'])) {
77
    if (!isset($options['dossier'])) {
78
        return '<p class="pap_erreur">'."Aucun dossier d'images passé en paramêtre!".'</p>';
78
        $GLOBALS['_GALLERIE_']['erreur'] = "Applette GALLERIE : le paramètre 'dossier' est obligatoire !";
79
    }
79
    }
80
    if (!isset($options['largeur'])) {
80
    if (!isset($options['largeur'])) {
81
        $options['largeur'] = 160;
81
        $options['largeur'] = 160;
82
    }
82
    }
Line 87... Line 87...
87
        $options['qualite'] = 70;
87
        $options['qualite'] = 70;
88
    }
88
    }
Line 89... Line 89...
89
	
89
	
90
	$noimage = 0;
90
	$noimage = 0;
-
 
91
	// Read directory
-
 
92
	$GLOBALS['_GALLERIE_']['dossier'] = PAP_CHEMIN_RACINE.$options['dossier'];
91
	// Read directory
93
	if (is_dir($GLOBALS['_GALLERIE_']['dossier'])) {
92
    if ($dh = opendir(PAP_CHEMIN_RACINE.$options['dossier'])) {
94
		if ($dh = opendir($GLOBALS['_GALLERIE_']['dossier'])) {
93
      while (($f = readdir($dh)) !== false) {
95
			while (($f = readdir($dh)) !== false) {
94
         if((substr(strtolower($f),-3) == 'jpg') || (substr(strtolower($f),-3) == 'gif') || (substr(strtolower($f),-3) == 'png')) {
96
				if((substr(strtolower($f),-3) == 'jpg') || (substr(strtolower($f),-3) == 'gif') || (substr(strtolower($f),-3) == 'png')) {
95
              $noimage++;
97
					$noimage++;
96
	          $images[] = array('filename' => $f);
98
					$images[] = array('filename' => $f);
97
              array_multisort($images, SORT_ASC, SORT_REGULAR); 
99
					array_multisort($images, SORT_ASC, SORT_REGULAR); 
98
         }
100
				}
99
      }
101
			}
100
      closedir($dh);
102
			closedir($dh);
-
 
103
		}
-
 
104
	} else {
-
 
105
		$GLOBALS['_GALLERIE_']['erreur'] = "Applette GALLERIE : le dossier d'images est introuvable à : ".$GLOBALS['_GALLERIE_']['dossier'];
101
    }
106
	}
102
    
107
   
103
   if($noimage) {
108
   if($noimage) {
104
   		$GLOBALS['_GALLERIE_']['css']['chemin'] = GALL_CHEMIN_STYLES;
109
   		$GLOBALS['_GALLERIE_']['css']['chemin'] = GALL_CHEMIN_STYLES;
105
   		$GLOBALS['_GALLERIE_']['css']['largeur'] = $options['largeur']+10;
110
   		$GLOBALS['_GALLERIE_']['css']['largeur'] = $options['largeur']+10;
106
   		$GLOBALS['_GALLERIE_']['script']['chemin'] = GALL_CHEMIN_SCRIPTS;
111
   		$GLOBALS['_GALLERIE_']['script']['chemin'] = GALL_CHEMIN_SCRIPTS;
Line 129... Line 134...
129
}
134
}
Line 130... Line 135...
130
 
135
 
131
/* +--Fin du code ----------------------------------------------------------------------------------------+
136
/* +--Fin du code ----------------------------------------------------------------------------------------+
132
*
137
*
-
 
138
* $Log: not supported by cvs2svn $
-
 
139
* Revision 1.1  2006/12/07 15:39:47  jp_milcent
-
 
140
* Ajout de l'applette Gallerie.
133
* $Log: not supported by cvs2svn $
141
*
134
*
142
*
135
* +-- Fin du code ----------------------------------------------------------------------------------------+
143
* +-- Fin du code ----------------------------------------------------------------------------------------+
136
*/
144
*/
137
?>
145
?>