/**
  * Constructeur de la classe inMyPluxml
  *
  * @param	default_lang	langue par défaut utilisée par PluXml
  * @return	null
  * @author	Stephane F
  **/
 public function __construct($default_lang)
 {
     # Appel du constructeur de la classe plxPlugin (obligatoire)
     parent::__construct($default_lang);
     if (defined('PLX_ADMIN')) {
         if (!empty($_GET['deletetoken']) && !empty($_GET['pasteid'])) {
             list($this->CIPHERDATA, $this->ERRORMESSAGE, $this->STATUS) = cmp_processPasteDelete(plxUtils::strCheck(plxUtils::nullbyteRemove($_GET['pasteid'])), plxUtils::strCheck(plxUtils::nullbyteRemove($_GET['deletetoken'])));
         } elseif (!empty($_SERVER['QUERY_STRING'])) {
             $zb = preg_replace('!(a=[0-9]+&?)*(zb=)?!', '', plxUtils::getGets($_SERVER['QUERY_STRING']));
             if (!empty($zb)) {
                 list($this->CIPHERDATA, $this->ERRORMESSAGE, $this->STATUS) = cmp_processPasteFetch($zb);
             }
         }
     }
     # Déclarations des hooks
     $this->addHook('ThemeEndHead', 'ThemeEndHead');
     $this->addHook('plxMotorPreChauffageBegin', 'plxMotorPreChauffageBegin');
     $this->addHook('plxMotorDemarrageBegin', 'plxMotorDemarrageBegin');
     $this->addHook('plxShowConstruct', 'plxShowConstruct');
     $this->addHook('AdminPrepend', 'Prepend');
     $this->addHook('IndexBegin', 'Prepend');
     $this->addHook('AdminTopEndHead', 'AdminTopEndHead');
     $this->addHook('AdminArticleTop', 'AdminArticleTop');
     // Pour n'enregistrer des données que via ZB, décommenter ces lignes
     // $this->addHook('AdminArticleContent', 'AdminArticleContent');
     // $this->addHook('AdminArticleFoot', 'AdminArticleFoot');
 }
Beispiel #2
0
    public function menuAdmin($ongletEnCours)
    {
        $listeOnglets = ["produits" => ["titre" => $this->getLang("L_MENU_PRODUCTS"), "urlHtml" => "plugin.php?p=plxMyShop"], "categories" => ["titre" => $this->getLang("L_MENU_CATS"), "urlHtml" => "plugin.php?p=plxMyShop&mod=cat"], "commandes" => ["titre" => $this->getLang("L_MENU_ORDERS"), "urlHtml" => "plugin.php?p=plxMyShop&mod=cmd"], "configuration" => ["titre" => $this->getLang("L_MENU_CONFIG"), "urlHtml" => "parametres_plugin.php?p=plxMyShop"]];
        foreach ($listeOnglets as $codeOnglet => $o) {
            ?>
				
				<a href="<?php 
            echo $o["urlHtml"];
            ?>
">
					<button<?php 
            echo $codeOnglet !== $ongletEnCours ? "" : " disabled";
            ?>
>
						<?php 
            echo plxUtils::strCheck($o["titre"]);
            ?>
					</button></a>
				&nbsp;&nbsp;&nbsp;&nbsp;
			<?php 
        }
    }
Beispiel #3
0
					<th>&nbsp;</th>
				</tr>
			</thead>
			<tbody>
			<?php 
# Initialisation de l'ordre
$num = 0;
# Si on a des catégories
if ($plxAdmin->aCats) {
    foreach ($plxAdmin->aCats as $k => $v) {
        # Pour chaque catégorie
        $ordre = ++$num;
        echo '<tr class="line-' . $num % 2 . '">';
        echo '<td><input type="checkbox" name="idCategory[]" value="' . $k . '" /><input type="hidden" name="catNum[]" value="' . $k . '" /></td>';
        echo '<td>' . $k . '</td><td>';
        plxUtils::printInput($k . '_name', plxUtils::strCheck($v['name']), 'text', '10-50');
        echo '</td><td>';
        plxUtils::printInput($k . '_url', $v['url'], 'text', '10-50');
        echo '</td><td>';
        plxUtils::printSelect($k . '_active', array('1' => L_YES, '0' => L_NO), $v['active']);
        echo '</td><td>';
        plxUtils::printSelect($k . '_tri', $aTri, $v['tri']);
        echo '</td><td>';
        plxUtils::printInput($k . '_bypage', $v['bypage'], 'text', '1-3');
        echo '</td><td>';
        plxUtils::printInput($k . '_ordre', $ordre, 'text', '1-3');
        echo '</td><td>';
        plxUtils::printSelect($k . '_menu', array('oui' => L_DISPLAY, 'non' => L_HIDE), $v['menu']);
        echo '</td>';
        echo '<td><a href="categorie.php?p=' . $k . '">' . L_OPTIONS . '</a></td>';
        echo '</tr>';
 /**
  * Méthode qui sauvegarde le fichier des parametres du plugin parameters.xml
  *
  * @return	boolean		resultat de la sauvegarde / TRUE = ok
  * @author	Stephane F
  **/
 public function saveParams()
 {
     # Début du fichier XML
     $xml = "<?xml version='1.0' encoding='" . PLX_CHARSET . "'?>\n";
     $xml .= "<document>\n";
     foreach ($this->aParams as $k => $v) {
         switch ($v['type']) {
             case 'numeric':
                 $xml .= "\t<parameter name=\"{$k}\" type=\"" . $v['type'] . "\">" . intval($v['value']) . "</parameter>\n";
                 break;
             case 'string':
                 $xml .= "\t<parameter name=\"{$k}\" type=\"" . $v['type'] . "\">" . plxUtils::cdataCheck(plxUtils::strCheck($v['value'])) . "</parameter>\n";
                 break;
             case 'cdata':
                 $xml .= "\t<parameter name=\"{$k}\" type=\"" . $v['type'] . "\"><![CDATA[" . plxUtils::cdataCheck($v['value']) . "]]></parameter>\n";
                 break;
         }
     }
     $xml .= "</document>";
     # On écrit le fichier
     if (plxUtils::write($xml, $this->plug['parameters.xml'])) {
         # suppression ancien fichier parameters.xml s'il existe encore (5.1.7+)
         if (file_exists($this->plug['dir'] . $this->plug['name'] . '/parameters.xml')) {
             unlink($this->plug['dir'] . $this->plug['name'] . '/parameters.xml');
         }
         return plxMsg::Info(L_SAVE_SUCCESSFUL);
     } else {
         return plxMsg::Error(L_SAVE_ERR . ' ' . $this->plug['parameters.xml']);
     }
 }
Beispiel #5
0
$nbreponse = floor(sizeof($plxPlugin->getParams()) / 2);
if (!empty($_POST)) {
    if (!empty($_POST['question-new']) and !empty($_POST['reponse-new'])) {
        # création d'un nouveau reponse
        $newreponse = $nbreponse + 1;
        $plxPlugin->setParam('question' . $newreponse, plxUtils::strCheck($_POST['question-new']), 'cdata');
        $plxPlugin->setParam('reponse' . $newreponse, plxUtils::strCheck($_POST['reponse-new']), 'cdata');
        $plxPlugin->saveParams();
    } else {
        # Mise à jour des reponses existants
        for ($i = 1; $i <= $nbreponse; $i++) {
            if ($_POST['delete' . $i] != "1" and !empty($_POST['question' . $i]) and !empty($_POST['reponse' . $i])) {
                // si on ne supprime pas et que les reponses ne sont pas vide
                #mise a jour du question et reponse
                $plxPlugin->setParam('question' . $i, plxUtils::strCheck($_POST['question' . $i]), 'cdata');
                $plxPlugin->setParam('reponse' . $i, plxUtils::strCheck($_POST['reponse' . $i]), 'cdata');
                $plxPlugin->saveParams();
            } elseif ($_POST['delete' . $i] == "1") {
                $plxPlugin->setParam('question' . $i, '', '');
                $plxPlugin->setParam('reponse' . $i, '', '');
                $plxPlugin->saveParams();
            }
        }
    }
}
# mise à jour du nombre de reponses existants
$nbreponse = floor(sizeof($plxPlugin->getParams()) / 2);
?>

<!-- navigation sur la page configuration du plugin -->
<nav id="tabby-1" class="tabby-tabs" data-for="example-tab-content">
Beispiel #6
0
				<p>Par <strong><?php 
        echo $plxAdmin->plxRecord_coms->f('author');
        ?>
</strong> 
				le <?php 
        echo plxDate::dateIsoToHum($plxAdmin->plxRecord_coms->f('date'), '#day #num_day #month #num_year(4) &agrave; #hour:#minute');
        ?>
				 - <a href="commentaire.php<?php 
        echo !empty($_GET['a']) ? '?c=' . $comId . '&amp;a=' . $_GET['a'] : '?c=' . $comId;
        ?>
" title="&Eacute;diter ce commentaire">&eacute;diter</a>
				 - <a href="javascript:answerCom('content','<?php 
        echo $plxAdmin->plxRecord_coms->f('numero');
        ?>
','<?php 
        echo plxUtils::strCheck($plxAdmin->plxRecord_coms->f('author'));
        ?>
');" title="R&Eacute;pondre &agrave; ce commentaire">r&eacute;pondre</a>
				</p>
			</div>
			<blockquote><p><?php 
        echo nl2br($plxAdmin->plxRecord_coms->f('content'));
        ?>
</p></blockquote>
		</div>
	<?php 
    }
    ?>
	</div>
<?php 
}
 /**
  * Méthode qui effectue une mise a jour d'un commentaire
  *
  * @param	content	données du commentaire à mettre à jour
  * @param	id	identifiant du commentaire
  * @return	string
  * @author	Stephane F. et Florent MONTHEL
  **/
 public function editCommentaire($content, &$id)
 {
     # Vérification de la validité de la date de publication
     if (!plxDate::checkDate($content['day'], $content['month'], $content['year'], $content['time'])) {
         return plxMsg::Error(L_ERR_INVALID_PUBLISHING_DATE);
     }
     $comment = array();
     # Génération du nom du fichier
     $comment['filename'] = $id . '.xml';
     if (!file_exists(PLX_ROOT . $this->aConf['racine_commentaires'] . $comment['filename'])) {
         # Commentaire inexistant
         return plxMsg::Error(L_ERR_UNKNOWN_COMMENT);
     }
     # Contrôle des saisies
     if (trim($content['mail']) != '' and !plxUtils::checkMail(trim($content['mail']))) {
         return plxMsg::Error(L_ERR_INVALID_EMAIL);
     }
     if (trim($content['site']) != '' and !plxUtils::checkSite($content['site'])) {
         return plxMsg::Error(L_ERR_INVALID_SITE);
     }
     # On récupère les infos du commentaire
     $com = $this->parseCommentaire(PLX_ROOT . $this->aConf['racine_commentaires'] . $comment['filename']);
     # Formatage des données
     $comment['author'] = plxUtils::strCheck(trim($content['author']));
     $comment['site'] = plxUtils::strCheck(trim($content['site']));
     if ($com['type'] != 'admin') {
         $comment['content'] = plxUtils::strCheck(trim($content['content']));
     } else {
         $comment['content'] = strip_tags(trim($content['content']), '<a>,<strong>');
     }
     $comment['ip'] = $com['ip'];
     $comment['type'] = $com['type'];
     $comment['mail'] = $content['mail'];
     $comment['site'] = $content['site'];
     $comment['parent'] = $com['parent'];
     # Génération du nouveau nom du fichier
     $time = explode(':', $content['time']);
     $newtimestamp = mktime($time[0], $time[1], 0, $content['month'], $content['day'], $content['year']);
     $com = $this->comInfoFromFilename($id . '.xml');
     $newid = $com['comStatus'] . $com['artId'] . '.' . $newtimestamp . '-' . $com['comIdx'];
     $comment['filename'] = $newid . '.xml';
     # Suppression de l'ancien commentaire
     $this->delCommentaire($id);
     # Création du nouveau commentaire
     $id = $newid;
     if ($this->addCommentaire($comment)) {
         return plxMsg::Info(L_COMMENT_SAVE_SUCCESSFUL);
     } else {
         return plxMsg::Error(L_COMMENT_UPDATE_ERR);
     }
 }
Beispiel #8
0
 /**
  * Méthode qui crée un nouveau commentaire pour l'article $artId
  *
  * @param	artId	identifiant de l'article en question
  * @param	content	tableau contenant les valeurs du nouveau commentaire
  * @return	string
  * @author	Florent MONTHEL, Stéphane F
  **/
 public function newCommentaire($artId, $content)
 {
     # Hook plugins
     if (eval($this->plxPlugins->callHook('plxMotorNewCommentaire'))) {
         return;
     }
     if (strtolower($_SERVER['REQUEST_METHOD']) != 'post' or !isset($_SESSION["capcha_token"]) or !isset($_POST['capcha_token']) or $_SESSION["capcha_token"] != $_POST['capcha_token']) {
         return L_NEWCOMMENT_ERR_ANTISPAM;
     }
     # On vérifie que le capcha est correct
     if ($this->aConf['capcha'] == 0 or $_SESSION['capcha'] == sha1($content['rep'])) {
         if (!empty($content['name']) and !empty($content['content'])) {
             # Les champs obligatoires sont remplis
             $comment = array();
             $comment['type'] = 'normal';
             $comment['author'] = plxUtils::strCheck(trim($content['name']));
             $comment['content'] = plxUtils::strCheck(trim($content['content']));
             # On vérifie le mail
             $comment['mail'] = plxUtils::checkMail(trim($content['mail'])) ? trim($content['mail']) : '';
             # On vérifie le site
             $comment['site'] = plxUtils::checkSite($content['site']) ? $content['site'] : '';
             # On récupère l'adresse IP du posteur
             $comment['ip'] = plxUtils::getIp();
             # index du commentaire
             $idx = $this->nextIdArtComment($idArt);
             # Commentaire parent en cas de réponse
             if (isset($content['parent']) and !empty($content['parent'])) {
                 $comment['parent'] = intval($content['parent']);
             } else {
                 $comment['parent'] = '';
             }
             # On génère le nom du fichier
             $time = time();
             if ($this->aConf['mod_com']) {
                 # On modère le commentaire => underscore
                 $comment['filename'] = '_' . $artId . '.' . $time . '-' . $idx . '.xml';
             } else {
                 # On publie le commentaire directement
                 $comment['filename'] = $artId . '.' . $time . '-' . $idx . '.xml';
             }
             # On peut créer le commentaire
             if ($this->addCommentaire($comment)) {
                 # Commentaire OK
                 if ($this->aConf['mod_com']) {
                     # En cours de modération
                     return 'mod';
                 } else {
                     # Commentaire publie directement, on retourne son identifiant
                     return 'c' . $artId . '-' . $idx;
                 }
             } else {
                 # Erreur lors de la création du commentaire
                 return L_NEWCOMMENT_ERR;
             }
         } else {
             # Erreur de remplissage des champs obligatoires
             return L_NEWCOMMENT_FIELDS_REQUIRED;
         }
     } else {
         # Erreur de vérification capcha
         return L_NEWCOMMENT_ERR_ANTISPAM;
     }
 }
</th>
		</tr>
	</thead>
	<tbody>
	<?php 
# Initialisation de l'ordre
$num = 0;
if ($plxAdmin->aUsers) {
    foreach ($plxAdmin->aUsers as $_userid => $_user) {
        if (!$_user['delete']) {
            echo '<tr class="line-' . $num % 2 . '">';
            echo '<td><input type="checkbox" name="idUser[]" value="' . $_userid . '" /><input type="hidden" name="userNum[]" value="' . $_userid . '" /></td>';
            echo '<td>' . $_userid . '</td><td>';
            plxUtils::printInput($_userid . '_name', plxUtils::strCheck($_user['name']), 'text', '10-255');
            echo '</td><td>';
            plxUtils::printInput($_userid . '_login', plxUtils::strCheck($_user['login']), 'text', '10-255');
            echo '</td><td>';
            plxUtils::printInput($_userid . '_password', '', 'password', '10-255');
            echo '</td><td>';
            if ($_userid == '001') {
                plxUtils::printInput($_userid . '_profil', $_user['profil'], 'hidden');
                plxUtils::printInput($_userid . '_active', $_user['active'], 'hidden');
                plxUtils::printSelect($_userid . '__profil', $aProfils, $_user['profil'], true, 'readonly');
                echo '</td><td>';
                plxUtils::printSelect($_userid . '__active', array('1' => L_YES, '0' => L_NO), $_user['active'], true, 'readonly');
            } else {
                plxUtils::printSelect($_userid . '_profil', $aProfils, $_user['profil']);
                echo '</td><td>';
                plxUtils::printSelect($_userid . '_active', array('1' => L_YES, '0' => L_NO), $_user['active']);
            }
            echo '</td>';
Beispiel #10
0
<link rel="stylesheet" type="text/css" href="admin.css" media="screen" />
</head>

<body id="auth">
<form action="auth.php<?php 
echo !empty($_GET['p']) ? '?p=' . urldecode($_GET['p']) : '';
?>
" method="post">
	<fieldset>
		<legend>Connexion &agrave; la zone d'administration :</legend>
		<?php 
!empty($msg) ? plxUtils::showMsg($msg, $error) : '';
?>
		<label>Login de connexion&nbsp;:</label>
		<?php 
plxUtils::printInput('login', !empty($_POST['login']) ? plxUtils::strCheck($_POST['login']) : '', 'text', '18-255');
?>
<br />
		<label>Mot de passe&nbsp;:</label>
		<?php 
plxUtils::printInput('password', '', 'password', '18-255');
?>
<br />
		<input type="submit" value="Valider" />
	</fieldset>
</form>

<p class="auth_return"><a href="<?php 
echo PLX_ROOT;
?>
">Retour au site</a> | G&eacute;n&eacute;r&eacute; par <a href="http://pluxml.org">PluXml</a></p>
Beispiel #11
0
				<label for="id_meta_description"><?php 
echo L_EDITCAT_META_DESCRIPTION;
?>
&nbsp;:</label>
				<?php 
plxUtils::printInput('meta_description', plxUtils::strCheck($plxAdmin->aCats[$id]['meta_description']), 'text', '50-255');
?>
			</div>
		</div>
		<div class="grid">
			<div class="col sml-12">
				<label for="id_meta_keywords"><?php 
echo L_EDITCAT_META_KEYWORDS;
?>
&nbsp;:</label>
				<?php 
plxUtils::printInput('meta_keywords', plxUtils::strCheck($plxAdmin->aCats[$id]['meta_keywords']), 'text', '50-255');
?>
			</div>
		</div>
	</fieldset>
	<?php 
eval($plxAdmin->plxPlugins->callHook('AdminCategory'));
?>
</form>

<?php 
# Hook Plugins
eval($plxAdmin->plxPlugins->callHook('AdminCategoryFoot'));
# On inclut le footer
include dirname(__FILE__) . '/foot.php';
Beispiel #12
0
        }
        # en attente de validation ?
        $idArt = $plxAdmin->plxRecord_arts->f('numero');
        $awaiting = $idArt[0] == '_' ? ' - <strong>' . L_AWAITING . '</strong>' : '';
        # Commentaires
        $nbComsToValidate = $plxAdmin->getNbCommentaires('/^_' . $idArt . '.(.*).xml$/', 'all');
        $nbComsValidated = $plxAdmin->getNbCommentaires('/^' . $idArt . '.(.*).xml$/', 'all');
        # On affiche la ligne
        echo '<tr>';
        echo '<td><input type="checkbox" name="idArt[]" value="' . $idArt . '" /></td>';
        echo '<td>' . $idArt . '</td>';
        echo '<td>' . plxDate::formatDate($plxAdmin->plxRecord_arts->f('date')) . '&nbsp;</td>';
        echo '<td class="wrap"><a href="article.php?a=' . $idArt . '" title="' . L_ARTICLE_EDIT_TITLE . '">' . plxUtils::strCheck($plxAdmin->plxRecord_arts->f('title')) . '</a>' . $draft . $awaiting . '&nbsp;</td>';
        echo '<td>' . $libCats . '&nbsp;</td>';
        echo '<td><a title="' . L_NEW_COMMENTS_TITLE . '" href="comments.php?sel=offline&amp;a=' . $plxAdmin->plxRecord_arts->f('numero') . '&amp;page=1">' . $nbComsToValidate . '</a> / <a title="' . L_VALIDATED_COMMENTS_TITLE . '" href="comments.php?sel=online&amp;a=' . $plxAdmin->plxRecord_arts->f('numero') . '&amp;page=1">' . $nbComsValidated . '</a>&nbsp;</td>';
        echo '<td>' . plxUtils::strCheck($author) . '&nbsp;</td>';
        echo '<td>';
        echo '<a href="article.php?a=' . $idArt . '" title="' . L_ARTICLE_EDIT_TITLE . '">' . L_ARTICLE_EDIT . '</a>';
        if ($publi and $draft == '') {
            # Si l'article est publié
            echo ' | <a href="' . PLX_ROOT . '?article' . intval($idArt) . '/' . $plxAdmin->plxRecord_arts->f('url') . '" title="' . L_ARTICLE_VIEW_TITLE . '">' . L_ARTICLE_VIEW . '</a>';
        }
        echo "&nbsp;</td>";
        echo "</tr>";
    }
} else {
    # Pas d'article
    echo '<tr><td colspan="8" class="center">' . L_NO_ARTICLE . '</td></tr>';
}
?>
		</tbody>
Beispiel #13
0
&nbsp;:</label>
			</div>
			<div class="col sml-12 med-7">
				<?php 
plxUtils::printInput('email', plxUtils::strCheck($plxAdmin->aUsers[$id]['email']), 'text', '30-255');
?>
			</div>
		</div>
		<div class="grid">
			<div class="col sml-12">
				<label for="id_content"><?php 
echo L_USER_INFOS;
?>
&nbsp;:</label>
				<?php 
plxUtils::printArea('content', plxUtils::strCheck($plxAdmin->aUsers[$id]['infos']), 95, 8);
?>
			</div>
		</div>
	</fieldset>
	<?php 
eval($plxAdmin->plxPlugins->callHook('AdminUser'));
?>

</form>

<?php 
# Hook Plugins
eval($plxAdmin->plxPlugins->callHook('AdminUserFoot'));
# On inclut le footer
include dirname(__FILE__) . '/foot.php';
Beispiel #14
0
 /**
  * Méthode qui insère le projet Honeypot, antispam
  */
 public function plxMotorDemarrageBegin()
 {
     define('HTTPBL_API_KEY', plxUtils::strCheck($this->getParam('httpbl_api_key')));
     require_once PLX_PLUGINS . 'honeypot/httpbl.php';
 }
Beispiel #15
0
" class="homepage" title="<?php 
        echo t('Back to site');
        ?>
"><?php 
        echo t('Back to site');
        ?>
</a>
		<br/>
		<?php 
        echo gu_config::get('application_name');
        ?>

	</li>
	<li class="user">
		<?php 
        echo plxUtils::strCheck($plxMotor->aUsers[$_SESSION['user']]['name']);
        ?>

	</li>
	<li class="profil">
		<?php 
        if ($_SESSION['profil'] == PROFIL_ADMIN) {
            printf('%s', L_PROFIL_ADMIN);
        } elseif ($_SESSION['profil'] == PROFIL_MANAGER) {
            printf('%s', L_PROFIL_MANAGER);
        }
        ?>

	</li>
	<li class="pluxml">
        <a title="PluXml" href="http://www.pluxml.org">Pluxml <?php 
Beispiel #16
0
		        <p>
		            <label for="label2"><?php 
echo $label2;
?>
</label>
		            <input type="text" name="mail-new" value="" />
		        </p>

		        <p>
					<label for="avatar">Avatar
					<a id="toggler_thumbnail" href="javascript:void(0)" onclick="mediasManager.openPopup('avatar-new', true)">+</a>
					</label>

					<input id="avatar-new" name="avatar-new"  maxlength="255" value="<?php 
echo plxUtils::strCheck($plxPlugin->getParam("avatar-new"));
?>
">
				</p>                                                                 
		                       
		        <p class="in-action-bar">
		            <?php 
echo plxToken::getTokenPostMethod();
?>
		            <input class="bt" type="submit" name="submit" value="Sauvegarder" />
		        </p>

		    </form>	

	</div>
Beispiel #17
0
if ($plxMedias->aFiles) {
    foreach ($plxMedias->aFiles as $v) {
        # Pour chaque fichier
        $isImage = in_array(strtolower($v['extension']), array('.png', '.gif', '.jpg'));
        $ordre = ++$num;
        echo '<tr class="line-' . $num % 2 . '">';
        echo '<td><input type="checkbox" name="idFile[]" value="' . $v['name'] . '" /></td>';
        echo '<td class="icon">';
        if (is_file($v['path']) and $isImage) {
            echo '<a onclick="overlay(\'' . $v['path'] . '\');return false;" title="' . plxUtils::strCheck($v['name']) . '" href="' . $v['path'] . '"><img alt="" src="' . $v['.thumb'] . '" class="thumb" /></a>';
        }
        echo '</td>';
        echo '<td>';
        echo '<a onclick="this.target=\'_blank\';return true;" title="' . plxUtils::strCheck($v['name']) . '" href="' . $v['path'] . '">' . plxUtils::strCheck($v['name']) . '</a><br />';
        if ($isImage and is_file(plxUtils::thumbName($v['path']))) {
            echo '<a onclick="this.target=\'_blank\';return true;" title="' . L_MEDIAS_THUMB . ' : ' . plxUtils::strCheck($v['name']) . '" href="' . plxUtils::thumbName($v['path']) . '">' . L_MEDIAS_THUMB . '</a> : ' . $v['thumb']['infos'][0] . ' x ' . $v['thumb']['infos'][1] . ' (' . plxUtils::formatFilesize($v['thumb']['filesize']) . ')';
        }
        echo '</td>';
        echo '<td>' . strtoupper($v['extension']) . '</td>';
        echo '<td>' . plxUtils::formatFilesize($v['filesize']) . '</td>';
        $dimensions = '&nbsp;';
        if ($isImage and (isset($v['infos']) and isset($v['infos'][0]) and isset($v['infos'][1]))) {
            $dimensions = $v['infos'][0] . ' x ' . $v['infos'][1];
        }
        echo '<td>' . $dimensions . '</td>';
        echo '<td>' . plxDate::formatDate(plxDate::timestamp2Date($v['date'])) . '</td>';
        echo '</tr>';
    }
} else {
    echo '<tr><td colspan="7" class="center">' . L_MEDIAS_NO_FILE . '</td></tr>';
}
Beispiel #18
0
	.nextum input[type="submit"]{width: auto}
	.nextum textarea {min-height: 50px}
	.nextum label{font-style: italic}
</style>

<?php 
$script = $plxPlugin->getParam('script');
?>


<form action="plugin.php?p=Plugin" method="post" class="nextum">

	<p>
		<label for="data">Exemple:</label>
		<input id="data" name="data"  maxlength="255" value="<?php 
echo plxUtils::strCheck($plxPlugin->getParam("data"));
?>
">
	</p>

	<p>
		<label for="script"><?php 
$plxPlugin->lang('LABEL_JQUERY');
?>
</label>
		<select name="script" id="select">
			<option value="true"  <?php 
if ($script == 'true') {
    echo 'selected';
}
?>
	</div>

	<?php 
eval($plxAdmin->plxPlugins->callHook('AdminSettingsEdittplTop'));
?>

	<div class="grid">
		<div class="col sml-12">
			<label for="id_content"><?php 
echo L_CONTENT_FIELD;
?>
&nbsp;:</label>
			<?php 
plxUtils::printInput('tpl', plxUtils::strCheck($tpl), 'hidden');
?>
			<?php 
plxUtils::printArea('content', plxUtils::strCheck($content), 60, 20, false, 'full-width');
?>
			<?php 
eval($plxAdmin->plxPlugins->callHook('AdminSettingsEdittpl'));
?>
		</div>
	</div>
	
</form>

<?php 
# Hook Plugins
eval($plxAdmin->plxPlugins->callHook('AdminSettingsEdittplFoot'));
# On inclut le footer
include dirname(__FILE__) . '/foot.php';
Beispiel #20
0
        $menus[] = plxUtils::formatMenu(L_MENU_CONFIG_INFOS, PLX_CORE . 'admin/parametres_infos.php', L_MENU_CONFIG_INFOS_TITLE, 'menu-config');
    }
}
# récuperation des menus admin pour les plugins
foreach ($plxAdmin->plxPlugins->aPlugins as $plugName => $plugInstance) {
    if ($plugInstance and is_file(PLX_PLUGINS . $plugName . '/admin.php')) {
        if ($plxAdmin->checkProfil($plugInstance->getAdminProfil(), false)) {
            if ($plugInstance->adminMenu) {
                $menu = plxUtils::formatMenu(plxUtils::strCheck($plugInstance->adminMenu['title']), PLX_CORE . 'admin/plugin.php?p=' . $plugName, plxUtils::strCheck($plugInstance->adminMenu['caption']));
                if ($plugInstance->adminMenu['position'] != '') {
                    array_splice($menus, $plugInstance->adminMenu['position'] - 1, 0, $menu);
                } else {
                    $menus[] = $menu;
                }
            } else {
                $menus[] = plxUtils::formatMenu(plxUtils::strCheck($plugInstance->getInfo('title')), PLX_CORE . 'admin/plugin.php?p=' . $plugName, plxUtils::strCheck($plugInstance->getInfo('title')));
            }
        }
    }
}
# Hook Plugins
eval($plxAdmin->plxPlugins->callHook('AdminTopMenus'));
echo implode('', $menus);
?>
			</ul>
		</nav>
	</aside>

	<section class="section col sml-12 med-9 med-offset-3 lrg-10 lrg-offset-2">

		<?php 
Beispiel #21
0
 /**
  * Méthode qui effectue une mise a jour d'un commentaire
  *
  * @param	content	données du commentaire à mettre à jour
  * @param	id	identifiant du commentaire
  * @return	string
  * @author	Stephane F. et Florent MONTHEL
  **/
 public function editCommentaire($content, $id)
 {
     # Génération du nom du fichier
     $filename = PLX_ROOT . $this->aConf['racine_commentaires'] . $id . '.xml';
     if (!file_exists($filename)) {
         # Commentaire inexistant
         return plxMsg::Error('Le commentaire demand&eacute; n\'existe pas ou n\'existe plus');
     }
     # On récupère les infos du commentaire
     $com = $this->parseCommentaire($filename);
     # On le remplace
     if ($com['type'] != 'admin') {
         $content['content'] = plxUtils::strCheck($content['content']);
     } else {
         $content['content'] = strip_tags($content['content'], '<a>,<strong>');
     }
     $this->delCommentaire($id);
     $this->addCommentaire($filename, $com['author'], $com['type'], $com['ip'], $com['mail'], $com['site'], $content['content']);
     if (is_readable($filename)) {
         return plxMsg::Info('Commentaire modifi&eacute; avec succ&egrave;s');
     } else {
         return plxMsg::Error('Erreur lors de la mise &agrave; jour du commentaire');
     }
 }
Beispiel #22
0
?>
						<h1 class="h5 text-center"><strong><?php 
echo L_LOGIN_PAGE;
?>
</strong></h1>
						<?php 
!empty($msg) ? plxUtils::showMsg($msg, $error) : '';
?>
						<div class="grid">
							<div class="col sml-12">
								<label for="id_login"><?php 
echo L_AUTH_LOGIN_FIELD;
?>
&nbsp;:</label>
								<?php 
plxUtils::printInput('login', !empty($_POST['login']) ? plxUtils::strCheck($_POST['login']) : '', 'text', '10-255', false, 'full-width');
?>
							</div>
						</div>
						<div class="grid">
							<div class="col sml-12">
								<label for="id_password"><?php 
echo L_AUTH_PASSWORD_FIELD;
?>
&nbsp;:</label>
								<?php 
plxUtils::printInput('password', '', 'password', '10-255', false, 'full-width');
?>
							</div>
						</div>
						<?php 
Beispiel #23
0
<h2>Edition de votre profil</h2>

<form action="profil.php" method="post" id="change-profil-file">
	<fieldset class="withlabel">
		<legend>Profil :</legend>
		<p class="field"><label>Login de connexion&nbsp;:</label>&nbsp;<strong><?php 
echo plxUtils::strCheck($profil['login']);
?>
</strong></p>
		<p class="field"><label>Nom d'utilisateur&nbsp;:</label></p>
		<?php 
plxUtils::printInput('name', plxUtils::strCheck($profil['name']), 'text', '20-255');
?>
		<p class="field"><label>Informations&nbsp;:</label></p>
		<?php 
plxUtils::printArea('infos', plxUtils::strCheck($profil['infos']), 140, 5);
?>
	</fieldset>
	<p class="center"><input type="submit" name="profil" value="Modifier votre profil" /></p>	
	<fieldset class="withlabel">
		<legend>Changement du mot de passe :</legend>
		<p class="field"><label>Mot de passe&nbsp;:</label></p>
		<?php 
plxUtils::printInput('password1', '', 'password', '20-255');
?>
		<p class="field"><label>Confirmation du mot de passe&nbsp;:</label></p>
		<?php 
plxUtils::printInput('password2', '', 'password', '20-255');
?>
		
	</fieldset>
Beispiel #24
0
    if (!empty($_POST['option-new']) and !empty($_POST['price-new'])) {
        # création d'un nouveau price
        $newprice = $nbprice + 1;
        $plxPlugin->setParam('option' . $newprice, plxUtils::strCheck($_POST['option-new']), 'cdata');
        $plxPlugin->setParam('price' . $newprice, plxUtils::strCheck($_POST['price-new']), 'cdata');
        $plxPlugin->setParam('active' . $newprice, plxUtils::strCheck($_POST['active-new']), 'cdata');
        $plxPlugin->saveParams();
    } else {
        # Mise à jour des prices existants
        for ($i = 1; $i <= $nbprice; $i++) {
            if ($_POST['delete' . $i] != "1" and !empty($_POST['option' . $i]) and !empty($_POST['price' . $i])) {
                // si on ne supprime pas et que les prices ne sont pas vide
                #mise a jour du option et price
                $plxPlugin->setParam('option' . $i, plxUtils::strCheck($_POST['option' . $i]), 'cdata');
                $plxPlugin->setParam('price' . $i, plxUtils::strCheck($_POST['price' . $i]), 'cdata');
                $plxPlugin->setParam('active' . $i, plxUtils::strCheck($_POST['active' . $i]), 'cdata');
                $plxPlugin->saveParams();
            } elseif ($_POST['delete' . $i] == "1") {
                $plxPlugin->setParam('option' . $i, '', '');
                $plxPlugin->setParam('price' . $i, '', '');
                $plxPlugin->setParam('active' . $i, '', '');
                $plxPlugin->saveParams();
            }
        }
    }
}
# mise à jour du nombre de membres existants
$nbmembres = floor(sizeof($plxPlugin->getParams()) / 2);
$mnuDisplay = $plxPlugin->getParam('mnuDisplay') == '' ? 1 : $plxPlugin->getParam('mnuDisplay');
$mnuName = $plxPlugin->getParam('mnuName') == '' ? 'Price' : $plxPlugin->getParam('mnuName');
$mnuPos = $plxPlugin->getParam('mnuPos') == '' ? 2 : $plxPlugin->getParam('mnuPos');
Beispiel #25
0
plxUtils::printSelect('feed_chapo', array('1' => L_YES, '0' => L_NO), $plxAdmin->aConf['feed_chapo']);
?>
				<a class="hint"><span><?php 
echo L_CONFIG_VIEW_FEEDS_HEADLINE_HELP;
?>
</span></a>
			</div>
		</div>
		<div class="grid">
			<div class="col sml-12">
				<label for="id_content"><?php 
echo L_CONFIG_VIEW_FEEDS_FOOTER;
?>
&nbsp;:</label>
				<?php 
plxUtils::printArea('content', plxUtils::strCheck($plxAdmin->aConf['feed_footer']), 140, 5);
?>
			</div>
		</div>

	</fieldset>

	<?php 
eval($plxAdmin->plxPlugins->callHook('AdminSettingsDisplay'));
?>
	<?php 
echo plxToken::getTokenPostMethod();
?>

</form>
$plxAdmin->getCommentaires('/^_' . $artRegex . '.(.*).xml$/', 'rsort', $start, $plxAdmin->aConf['bypage_admin_coms'], 'all');
if ($plxAdmin->plxGlob_coms->count and !empty($plxAdmin->plxRecord_coms->size)) {
    # On a des commentaires
    while ($plxAdmin->plxRecord_coms->loop()) {
        # On boucle
        $year = substr($plxAdmin->plxRecord_coms->f('date'), 0, 4);
        $month = substr($plxAdmin->plxRecord_coms->f('date'), 5, 2);
        $day = substr($plxAdmin->plxRecord_coms->f('date'), 8, 2);
        $time = substr($plxAdmin->plxRecord_coms->f('date'), 11, 8);
        $artId = $plxAdmin->plxRecord_coms->f('article');
        $id = '_' . $artId . '.' . $plxAdmin->plxRecord_coms->f('numero');
        # On coupe le commentaire mais attention aux entités HTML
        if ($plxAdmin->plxRecord_coms->f('type') == 'admin') {
            $content = plxUtils::strCut(strip_tags($plxAdmin->plxRecord_coms->f('content')), 70);
        } else {
            $content = plxUtils::strCheck(plxUtils::strCut(plxUtils::strRevCheck($plxAdmin->plxRecord_coms->f('content')), 70));
        }
        # On génère notre ligne
        echo '<tr class="line-' . $plxAdmin->plxRecord_coms->i % 2 . '">';
        echo '<td><input type="checkbox" name="idCom[]" value="' . $id . '" /></td>';
        echo '<td>&nbsp;' . $day . '/' . $month . '/' . $year . ' ' . $time . '</td>';
        echo '<td>&nbsp;' . plxUtils::strCut($plxAdmin->plxRecord_coms->f('author'), 15) . '</td>';
        echo '<td>&nbsp;<a href="commentaire.php?c=' . $id . (!empty($_GET['a']) ? '&amp;a=' . $_GET['a'] : '') . '" title="&Eacute;diter ce commentaire">' . $content . '</a></td>';
        echo '<td style="text-align:center"> ';
        echo '<a href="commentaire.php?c=' . $id . (!empty($_GET['a']) ? '&amp;a=' . $_GET['a'] : '') . '" title="&Eacute;diter ce commentaire">&Eacute;diter</a> - ';
        echo '<a href="article.php?a=' . $artId . '" title="Article attach&eacute; &agrave; ce commentaire">Article</a>';
        echo '</td></tr>';
    }
    ?>
	<tr>
		<td colspan="5">
# chargement du fichier d'administration du plugin
$filename = realpath(PLX_PLUGINS . $plugin . '/config.php');
if (is_file($filename)) {
    # si le plugin n'est pas actif, aucune instance n'a été créée, on va donc la créer, sinon on prend celle qui existe
    if (!isset($plxAdmin->plxPlugins->aPlugins[$plugin])) {
        $plxPlugin = $plxAdmin->plxPlugins->getInstance($plugin);
    } else {
        $plxPlugin = $plxAdmin->plxPlugins->aPlugins[$plugin];
    }
    # Control des autorisation d'accès à l'écran config.php du plugin
    $plxAdmin->checkProfil($plxPlugin->getConfigProfil());
    # chargement de l'écran de paramétrage du plugin config.php
    ob_start();
    echo '
	<div class="inline-form action-bar">
		<h2>' . plxUtils::strCheck($plugin) . '</h2>
		<p><a class="back" href="parametres_plugins.php">' . L_BACK_TO_PLUGINS . '</a></p>
	</div>';
    include $filename;
    $output = ob_get_clean();
} else {
    plxMsg::Error(L_NO_ENTRY);
    header('Location: parametres_plugins.php');
    exit;
}
# On inclut le header
include dirname(__FILE__) . '/top.php';
# Affichage des données
echo $output;
# On inclut le footer
include dirname(__FILE__) . '/foot.php';
Beispiel #28
0
echo L_STATIC_META_DESCRIPTION;
?>
&nbsp;:</label>
					<?php 
plxUtils::printInput('meta_description', plxUtils::strCheck($meta_description), 'text', '50-255');
?>
				</div>
			</div>
			<div class="grid">
				<div class="col sml-12">
					<label for="id_meta_keywords"><?php 
echo L_STATIC_META_KEYWORDS;
?>
&nbsp;:</label>
					<?php 
plxUtils::printInput('meta_keywords', plxUtils::strCheck($meta_keywords), 'text', '50-255');
?>
				</div>
			</div>
			<div class="grid">
				<div class="col sml-12">
					<label><?php 
echo L_DATE_CREATION;
?>
&nbsp;:</label>
					<div class="inline-form">
						<?php 
plxUtils::printInput('date_creation_day', $date_creation['day'], 'text', '2-2', false, 'day');
?>
						<?php 
plxUtils::printInput('date_creation_month', $date_creation['month'], 'text', '2-2', false, 'month');
Beispiel #29
0
                }
            } else {
                $libCats = 'Non class&eacute;';
            }
        }
        # Commentaires
        $nbComsToValidate = $plxAdmin->getNbCommentaires('/^_' . $plxAdmin->plxRecord_arts->f('numero') . '.(.*).xml$/');
        $nbComsValidated = $plxAdmin->getNbCommentaires('/^' . $plxAdmin->plxRecord_arts->f('numero') . '.(.*).xml$/');
        # On affiche la ligne
        echo '<tr class="line-' . $plxAdmin->plxRecord_arts->i % 2 . '">';
        echo '<td><input type="checkbox" name="idArt[]" value="' . $plxAdmin->plxRecord_arts->f('numero') . '" /></td>';
        echo '<td class="tc1">&nbsp;' . $day . '/' . $month . '/' . $year . '</td>';
        echo '<td class="tc4">&nbsp;<a href="article.php?a=' . $plxAdmin->plxRecord_arts->f('numero') . '" title="&Eacute;diter cet article">' . plxUtils::strCheck(plxUtils::strCut($plxAdmin->plxRecord_arts->f('title'), 60)) . '</a>' . $draft . '</td>';
        echo '<td class="tc1">&nbsp;' . $libCats . '</td>';
        echo '<td class="tc1" style="text-align:center">&nbsp;<a title="Commentaires en attente de validation" href="commentaires_offline.php?a=' . $plxAdmin->plxRecord_arts->f('numero') . '&amp;page=1">' . $nbComsToValidate . '</a> / <a title="Commentaires publi&eacute;s" href="commentaires_online.php?a=' . $plxAdmin->plxRecord_arts->f('numero') . '&amp;page=1">' . $nbComsValidated . '</a></td>';
        echo '<td class="tc4">&nbsp;' . plxUtils::strCheck($author) . '</td>';
        echo '<td class="tc4" style="text-align:center">&nbsp;';
        if ($publi and $draft == '') {
            # Si l'article est publié
            echo '<a href="' . PLX_ROOT . '?article' . intval($plxAdmin->plxRecord_arts->f('numero')) . '/' . $plxAdmin->plxRecord_arts->f('url') . '" title="Visualiser cet article sur le site">Visualiser</a> - ';
        }
        echo '<a href="article.php?a=' . $plxAdmin->plxRecord_arts->f('numero') . '" title="Editer cet article">&Eacute;diter</a>';
        echo "</td>";
        echo "</tr>";
    }
    ?>
	<tr>
		<td colspan="7">
			<?php 
    plxUtils::printSelect('selection', array('' => 'Pour la s&eacute;lection...', 'delete' => 'Supprimer'), '');
    ?>
function pluginsList($plugins, $defaultLang, $type)
{
    # plugins		array()		contient la liste des plugins à afficher
    # defaultLang	string		langue utilisée dans l'admin
    # type			true|false	true=liste des plugins actifs, false=liste des plugins inactifs
    $output = '';
    if (sizeof($plugins) > 0) {
        $num = 0;
        foreach ($plugins as $plugName => $plugInstance) {
            $ordre = ++$num;
            # détermination de l'icone à afficher
            if (is_file(PLX_PLUGINS . $plugName . '/icon.png')) {
                $icon = PLX_PLUGINS . $plugName . '/icon.png';
            } elseif (is_file(PLX_PLUGINS . $plugName . '/icon.jpg')) {
                $icon = PLX_PLUGINS . $plugName . '/icon.jpg';
            } elseif (is_file(PLX_PLUGINS . $plugName . '/icon.gif')) {
                $icon = PLX_PLUGINS . $plugName . '/icon.gif';
            } else {
                $icon = PLX_CORE . 'admin/theme/images/icon_plugin.png';
            }
            $output .= '<tr class="top">';
            # checkbox
            $output .= '<td>';
            $output .= '<input type="hidden" name="plugName[]" value="' . $plugName . '" />';
            $output .= '<input type="checkbox" name="chkAction[]" value="' . $plugName . '" />';
            $output .= '</td>';
            # icon
            $output .= '<td><img src="' . $icon . '" alt="" /></td>';
            # plugin infos
            $output .= '<td class="wrap">';
            # message d'alerte si plugin non configuré
            if ($type and file_exists(PLX_PLUGINS . $plugName . '/config.php') and !file_exists(PLX_ROOT . PLX_CONFIG_PATH . 'plugins/' . $plugName . '.xml')) {
                $output .= '<span style="margin-top:5px" class="alert red float-right">' . L_PLUGIN_NO_CONFIG . '</span>';
            }
            # title + version
            $output .= '<strong>' . plxUtils::strCheck($plugInstance->getInfo('title')) . '</strong> - ' . L_PLUGINS_VERSION . ' <strong>' . plxUtils::strCheck($plugInstance->getInfo('version')) . '</strong>';
            # date
            if ($plugInstance->getInfo('date') != '') {
                $output .= ' (' . plxUtils::strCheck($plugInstance->getInfo('date')) . ')';
            }
            # description
            $output .= '<br />' . plxUtils::strCheck($plugInstance->getInfo('description')) . '<br />';
            # author
            $output .= L_PLUGINS_AUTHOR . ' : ' . plxUtils::strCheck($plugInstance->getInfo('author'));
            # site
            if ($plugInstance->getInfo('site') != '') {
                $output .= ' - <a href="' . plxUtils::strCheck($plugInstance->getInfo('site')) . '">' . plxUtils::strCheck($plugInstance->getInfo('site')) . '</a>';
            }
            $output .= '</td>';
            # colonne pour trier les plugins
            if ($type) {
                $output .= '<td>';
                $output .= '<input size="2" maxlength="3" type="text" name="plugOrdre[' . $plugName . ']" value="' . $ordre . '" />';
                $output .= '</td>';
            }
            # affichage des liens du plugin
            $output .= '<td class="right">';
            # lien configuration
            if (is_file(PLX_PLUGINS . $plugName . '/config.php')) {
                $output .= '<a title="' . L_PLUGINS_CONFIG_TITLE . '" href="parametres_plugin.php?p=' . urlencode($plugName) . '">' . L_PLUGINS_CONFIG . '</a><br />';
            }
            # lien pour code css
            $output .= '<a title="' . L_PLUGINS_CSS_TITLE . '" href="parametres_plugincss.php?p=' . urlencode($plugName) . '">' . L_PLUGINS_CSS . '</a><br />';
            # lien aide
            if (is_file(PLX_PLUGINS . $plugName . '/lang/' . $defaultLang . '-help.php')) {
                $output .= '<a title="' . L_HELP_TITLE . '" href="parametres_help.php?help=plugin&amp;page=' . urlencode($plugName) . '">' . L_HELP . '</a>';
            }
            $output .= '</td>';
            $output .= '</tr>';
        }
    } else {
        $colspan = $_SESSION['selPlugins'] == '1' ? 5 : 4;
        $output .= '<tr><td colspan="' . $colspan . '" class="center">' . L_NO_PLUGIN . '</td></tr>';
    }
    return $output;
}