public function __construct($default_lang) { # appel du constructeur de la classe plxPlugin (obligatoire) parent::__construct($default_lang); # Récupération d'une instance de plxMotor $plxMotor = plxMotor::getInstance(); #init path $this->imgFullPath = isset($plxMotor->aConf['medias']) ? plxUtils::getRacine() . $plxMotor->aConf['medias'] : plxUtils::getRacine() . $plxMotor->aConf['images']; $this->imgPath = isset($plxMotor->aConf['medias']) ? $plxMotor->aConf['medias'] : $plxMotor->aConf['images']; # PROFIL_ADMIN , PROFIL_MANAGER , PROFIL_MODERATOR , PROFIL_EDITOR , PROFIL_WRITER # Accès au menu admin réservé au profil administrateur $this->setAdminProfil(PROFIL_ADMIN, PROFIL_MANAGER); # droits pour accèder à la page config.php du plugin $this->setConfigProfil(PROFIL_ADMIN); # Déclaration des hooks $this->addHook('AdminMediasTop', 'AdminMediasTop'); }
/** * Méthode qui retourne l'url du dossier du plugin (avec le http://) * * @return string url vers le dossier du plugin * @author Stephane F **/ public function URL() { return plxUtils::getRacine() . $this->ABS_PATH(); }
</comment>'; plxUtils::write($xml, PLX_ROOT . $config['racine_commentaires'] . '0001.' . date('U') . '-1.xml'); } $msg = ''; if (!empty($_POST['install'])) { if (trim($_POST['name'] == '')) { $msg = L_ERR_MISSING_USER; } elseif (trim($_POST['login'] == '')) { $msg = L_ERR_MISSING_LOGIN; } elseif (trim($_POST['pwd'] == '')) { $msg = L_ERR_MISSING_PASSWORD; } elseif ($_POST['pwd'] != $_POST['pwd2']) { $msg = L_ERR_PASSWORD_CONFIRMATION; } else { install($_POST, $config); header('Location: ' . plxUtils::getRacine()); exit; } $name = $_POST['name']; $login = $_POST['login']; } else { $name = ''; $login = ''; } plxUtils::cleanHeaders(); ?> <!DOCTYPE html> <head> <meta charset="<?php echo strtolower(PLX_CHARSET); ?>
/** * Méthode qui parse le fichier de configuration et alimente * le tableau aConf * * @param filename emplacement du fichier XML de configuration * @return null * @author Anthony GUÉRIN, Florent MONTHEL, Stéphane F **/ public function getConfiguration($filename) { # Mise en place du parseur XML $data = implode('', file($filename)); $parser = xml_parser_create(PLX_CHARSET); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 0); xml_parse_into_struct($parser, $data, $values, $iTags); xml_parser_free($parser); # On verifie qu'il existe des tags "parametre" if (isset($iTags['parametre'])) { # On compte le nombre de tags "parametre" $nb = sizeof($iTags['parametre']); # On boucle sur $nb for ($i = 0; $i < $nb; $i++) { if (isset($values[$iTags['parametre'][$i]]['value'])) { # On a une valeur pour ce parametre $this->aConf[$values[$iTags['parametre'][$i]]['attributes']['name']] = $values[$iTags['parametre'][$i]]['value']; } else { # On n'a pas de valeur $this->aConf[$values[$iTags['parametre'][$i]]['attributes']['name']] = ''; } } } # détermination automatique de la racine du site $this->aConf['racine'] = plxUtils::getRacine(); # On gère la non régression en cas d'ajout de paramètres sur une version de pluxml déjà installée $this->aConf['bypage_admin'] = plxUtils::getValue($this->aConf['bypage_admin'], 10); $this->aConf['tri_coms'] = plxUtils::getValue($this->aConf['tri_coms'], $this->aConf['tri']); $this->aConf['bypage_admin_coms'] = plxUtils::getValue($this->aConf['bypage_admin_coms'], 10); $this->aConf['bypage_archives'] = plxUtils::getValue($this->aConf['bypage_archives'], 5); $this->aConf['userfolders'] = plxUtils::getValue($this->aConf['userfolders'], 0); $this->aConf['meta_description'] = plxUtils::getValue($this->aConf['meta_description']); $this->aConf['meta_keywords'] = plxUtils::getValue($this->aConf['meta_keywords']); $this->aConf['default_lang'] = plxUtils::getValue($this->aConf['default_lang'], DEFAULT_LANG); $this->aConf['racine_plugins'] = plxUtils::getValue($this->aConf['racine_plugins'], 'plugins/'); $this->aConf['racine_themes'] = plxUtils::getValue($this->aConf['racine_themes'], 'themes/'); $this->aConf['mod_art'] = plxUtils::getValue($this->aConf['mod_art'], 0); $this->aConf['display_empty_cat'] = plxUtils::getValue($this->aConf['display_empty_cat'], 0); $this->aConf['timezone'] = plxUtils::getValue($this->aConf['timezone'], @date_default_timezone_get()); $this->aConf['thumbs'] = isset($this->aConf['thumbs']) ? $this->aConf['thumbs'] : 1; $this->aConf['hometemplate'] = isset($this->aConf['hometemplate']) ? $this->aConf['hometemplate'] : 'home.php'; $this->aConf['custom_admincss_file'] = plxUtils::getValue($this->aConf['custom_admincss_file']); $this->aConf['medias'] = isset($this->aConf['medias']) ? $this->aConf['medias'] : 'data/images/'; if (!defined('PLX_PLUGINS')) { define('PLX_PLUGINS', PLX_ROOT . $this->aConf['racine_plugins']); } }
</main> <?php eval($plxAdmin->plxPlugins->callHook('AdminFootEndBody')); ?> <script> setMsg(); mediasManager.construct({ windowName : "<?php echo L_MEDIAS_TITLE; ?> ", racine: "<?php echo plxUtils::getRacine(); ?> ", root: "<?php echo PLX_ROOT; ?> ", urlManager: "<?php echo PLX_CORE; ?> admin/medias.php", }); </script> </body>