Skip to content

Commit

Permalink
Update sendmail default skin
Browse files Browse the repository at this point in the history
* Add condition in htaccess
* Update css default skin
  • Loading branch information
gtraxx committed Jan 30, 2018
1 parent 299d531 commit 8505df4
Show file tree
Hide file tree
Showing 89 changed files with 5,781 additions and 409 deletions.
4 changes: 4 additions & 0 deletions .htaccess
Expand Up @@ -111,6 +111,10 @@ RewriteCond %{QUERY_STRING} !(year)+
RewriteRule (.*)/(\d{4})/{0,1}$ /$1?year=$2 [QSA,L]
RewriteCond %{QUERY_STRING} !(tag)+
RewriteRule (.*)/tag/([/0-9]+)[-]([-_0-9a-zA-Z]+)/{0,1}$ /$1?tag=$2 [QSA,L]
RewriteCond %{QUERY_STRING} !(action)+
RewriteRule (.*)/([0-9a-zA-Z]+)/{0,1}$ /$1?action=$2 [QSA,L]
RewriteCond %{QUERY_STRING} !(hash)+
RewriteRule (.*)/([0-9a-zA-Z]+)/{0,1}$ /$1?hash=$2 [QSA,L]
RewriteCond %{REQUEST_URI} !^/(admin|install|skin|media|upload)
RewriteRule ^([0-9a-zA-Z]+)/{0,1}$ /index.php?controller=$1 [QSA,L]

Expand Down
4 changes: 4 additions & 0 deletions admin/i18n/local_fr.conf
Expand Up @@ -17,13 +17,15 @@ cancel = Annuler
refresh = Actualiser
warning = Attention
search = Rechercher
reset = Réinitialiser
save_and_stay = enregistrer et rester
#Login
placeholder_login = test@example.com
placeholder_password = Mot de passe
login = se connecter
login_root = connexion
login_pwd = nouveau mot de passe
logout = Déconnexion
#Mail
titlemail = %1$s venant de %2$s
rstpwd = Demande de nouveau mot de passe
Expand Down Expand Up @@ -62,6 +64,7 @@ request_error_mail_account = Il n'existe aucun compte associé à cet email.
request_error_upload = Le fichier est endommagé ou trop grand
request_error_min = Vous ne pouvez pas supprimer tous les éléments
no_entry = Aucun élément enregistré.
no_result = Aucun élément ne corrrespond à votre recherche.
#modals
modal_delete_message = Vous êtes sur le point de supprimer cette entrée. Souhaitez-vous continuer* ?
modal_delete_info = * Les données seront supprimées.
Expand Down Expand Up @@ -93,6 +96,7 @@ root_employees = gérer vos employés
nbr_employee = nombre d'employés
add_employee = ajouter un employé
edit_employee = Éditer un employé
edit_profile = Editer le profil
delete_employee = supprimer cet employé(e) ?
#table_form
id = ID
Expand Down
2 changes: 2 additions & 0 deletions admin/index.php
Expand Up @@ -35,6 +35,7 @@
$members = new backend_controller_login();
$members->checkout();
if (http_request::isSession('keyuniqid_admin')) {
$members->getAdminProfile();
$dispatcher = new component_routing_dispatcher($routes, $template, $plugins);
$dispatcher->dispatch();
}
Expand All @@ -48,6 +49,7 @@
$members = new backend_controller_login();
$members->checkout();
if (http_request::isSession('keyuniqid_admin')) {
$members->getAdminProfile();
$pluginsSetConfig = new backend_model_plugins();
$pluginsSetConfig->addConfigDir($routes, $template);
$pluginsSetConfig->templateDir($routes, $template, $plugins);
Expand Down
2 changes: 1 addition & 1 deletion admin/template/css/desktop.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/template/css/mobile.min.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions admin/template/css/src/less/global/header.less
Expand Up @@ -90,6 +90,8 @@

@media (min-width: @screen-sm-min) {
#header {
overflow: visible;

.navbar-right {
margin-right: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion admin/template/css/tablet.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/template/js/form.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions admin/template/js/src/form.js
Expand Up @@ -183,6 +183,10 @@ var globalForm = (function ($, undefined) {
}
};
}
// --- Rules form search form
else if($(f).hasClass('pwd_form')) {
options.resetForm = true;
}
// --- Rules form classic edit form but with replace from extend data
else if($(f).hasClass('edit_form_extend')) {
options.success = function (d) {
Expand Down
2 changes: 1 addition & 1 deletion admin/template/section/form/loop/no-record.tpl
@@ -1,7 +1,7 @@
<tr>
<td colspan="{$col}">
<div class="alert alert-info text-center">
<p><span class="fa fa-info"></span>&nbsp;Aucune page trouvée pour cette recherche.</p>
<p><span class="fa fa-info"></span>&nbsp;{#no_result#|ucfirst} <a href="{$smarty.server.SCRIPT_NAME}?controller={$smarty.get.controller}" class="btn btn-info"><span class="fa fa-eraser"></span> {#reset#}</a></p>
</div>
</td>
</tr>
9 changes: 5 additions & 4 deletions admin/template/section/form/table-form-2.tpl
Expand Up @@ -18,7 +18,7 @@
{$sch.input|var_dump}
{/foreach}{/if}
{if $debug}{$data|var_dump}{/if}
<div class="table-responsive{if empty($data) || !count($data)} hide{/if}" id="table-{if $subcontroller}{$subcontroller}{else}{$controller}{/if}">
<div class="table-responsive{if (empty($data) || !count($data)) && !$smarty.get.search} hide{/if}" id="table-{if $subcontroller}{$subcontroller}{else}{$controller}{/if}">
<form action="{$smarty.server.REQUEST_URI}" method="get"{if $ajax_form} class="validate_form search_form"{/if}>
<input type="hidden" name="controller" value="{$smarty.get.controller}" />
<table class="table table-striped table-hover">
Expand Down Expand Up @@ -47,15 +47,16 @@
<select name="search[{$name}]" id="search[{$name}]" class="form-control" >
<option value="" selected>--</option>
{foreach $col.input.values as $val}
<option value="{$val.v}"{if isset($smarty.get.search[$name]) && $smarty.get.search[$name] =='{$val.v}'} selected{/if}>{if $col.input.var || !isset($val.name) || empty($val.name)}{$value = $col.enum|cat:$val.v}{#$value#}{else}{$val.name}{/if}</option>
<option value="{$val.v}"{if isset($smarty.get.search[$name]) && $smarty.get.search[$name] === $val.v} selected{/if}>{if $col.input.var || !isset($val.name) || empty($val.name)}{$value = $col.enum|cat:$val.v}{#$value#}{else}{$val.name}{/if}</option>
{/foreach}
</select>
{elseif $col.input.type == 'text'}
<input type="text"
id="search[{$name}]"
name="search[{$name}]"
class="form-control{if $col.input.class !== ''} {$col.input.class}{/if}"
{if isset($smarty.get.search[$name])}value="{$smarty.get.search[$name]}" {/if}/>
{if isset($smarty.get.search[$name])} value="{$smarty.get.search[$name]}"{/if}
{if isset($col.input.placeholder)} placeholder="{$col.input.placeholder}"{/if}/>
{/if}
</div>
</th>
Expand Down Expand Up @@ -141,7 +142,7 @@
</div>
</form>
</div>
<p class="no-entry alert alert-warning{if !empty($data) || count($data)} hide{/if}">
<p class="no-entry alert alert-warning{if ((!empty($data) || count($data)) && !$smarty.get.search) || $smarty.get.search} hide{/if}">
<span class="fa fa-info"></span> {#no_entry#|ucfirst}
</p>
{/if}
19 changes: 18 additions & 1 deletion admin/template/section/menu/account.tpl
Expand Up @@ -9,9 +9,26 @@
<span class="hidden-sm hidden-md hidden-lg"><span class="fa fa-arrow-right"></span></span> <span class="fa fa-desktop"></span><span class="hidden-ph hidden-xs"> Aller sur le site</span>
</a>
</li>
<li>
{*<li>
<a href="{geturl}/admin/index.php?controller=dashboard&logout=1">
<span class="fa fa-power-off"></span>
</a>
</li>*}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<span class="fa fa-user"></span> {$adminProfile.firstname_admin} <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="{geturl}/admin/index.php?controller=employee&action=edit&edit={$adminProfile.id_admin}">
<span class="fa fa-cog"></span> {#edit_profile#}
</a>
</li>
<li>
<a href="{geturl}/admin/index.php?controller=dashboard&logout=1">
<span class="fa fa-power-off"></span> {#logout#}
</a>
</li>
</ul>
</li>
</ul>
11 changes: 11 additions & 0 deletions app/backend/controller/login.php
Expand Up @@ -129,6 +129,17 @@ private function tokenInitSession(){
$session->token('ap_auth_token');
}

/**
* @throws Exception
*/
public function getAdminProfile()
{
if(isset($_SESSION['keyuniqid_admin'])) {
$adminProfile = parent::fetchData(array('type'=>'session'),array('keyuniqid_admin' => $_SESSION['keyuniqid_admin']));
$this->template->assign('adminProfile',$adminProfile);
}
}

/**
* Authentification sur la page de login
* @param bool $debug
Expand Down
14 changes: 7 additions & 7 deletions app/backend/model/data.php
Expand Up @@ -208,7 +208,7 @@ public function parseScheme($sch, $cols, $ass)
$column['type'] = 'date';

if(preg_match('/^date/i', $pre)) {
$column['input'] = array('type' => 'text', 'class' => 'date-input');
$column['input'] = array('type' => 'text', 'class' => 'date-input', 'placeholder' => '__/__/____');
}
else if(preg_match('/^time/i', $pre)){
$column['input'] = array('type' => 'text', 'class' => 'time-input');
Expand Down Expand Up @@ -274,15 +274,15 @@ public function getScheme($tables, $columns, $assign = null, $tpl_var = 'scheme'
$params = array(':dbname' => MP_DBNAME, 'table' => $tables, 'columns' => $cols);
try {
$scheme = parent::fetchData(array('context' => 'all', 'type' => 'scheme'), $params);
try {
$this->template->assign($tpl_var,$this->parseScheme($scheme, $columns, $assign));
} catch(Exception $e) {
$logger = new debug_logger(MP_LOG_DIR);
$logger->log('php', 'error', 'An error has occured : '.$e->getMessage(), debug_logger::LOG_MONTH);
}
} catch(Exception $e) {
$logger = new debug_logger(MP_LOG_DIR);
$logger->log('statement', 'db', 'An error has occured : '.$e->getMessage(), debug_logger::LOG_MONTH);
}
try {
$this->template->assign($tpl_var,$this->parseScheme($scheme, $columns, $assign));
} catch(Exception $e) {
$logger = new debug_logger(MP_LOG_DIR);
$logger->log('php', 'error', 'An error has occured : '.$e->getMessage(), debug_logger::LOG_MONTH);
}
}
}
9 changes: 6 additions & 3 deletions app/frontend/model/data.php
Expand Up @@ -11,7 +11,6 @@ public function __construct($caller)
$this->caller = $caller;
$this->db = (new ReflectionClass(get_parent_class($caller)))->newInstance();
$this->template = new frontend_model_template();

}

/**
Expand Down Expand Up @@ -85,13 +84,17 @@ private function setItems(&$context, $type, $id = null) {
* @param string $context
* @param boolean $assign
* @return mixed
* @throws Exception
*/
public function getItems($type, $id = null, $context = null, $assign = true) {
$data = $this->setItems($context, $type, $id);
if($assign) {
$varName = gettype($assign) == 'string' ? $assign : $type;
$this->template->assign($varName,$data);
try {
$this->template->assign($varName, $data);
} catch(Exception $e) {
$logger = new debug_logger(MP_LOG_DIR);
$logger->log('php', 'error', 'An error has occured : '.$e->getMessage(), debug_logger::LOG_MONTH);
}
}
return $data;
}
Expand Down
148 changes: 148 additions & 0 deletions app/frontend/model/session.php
@@ -0,0 +1,148 @@
<?php
/*
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of MAGIX CMS.
# MAGIX CMS, The content management system optimized for users
# Copyright (C) 2008 - 2013 magix-cms.com <support@magix-cms.com>
#
# OFFICIAL TEAM :
#
# * Gerits Aurelien (Author - Developer) <aurelien@magix-cms.com> <contact@aurelien-gerits.be>
#
# Redistributions of files must retain the above copyright notice.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# -- END LICENSE BLOCK -----------------------------------
#
# DISCLAIMER
#
# Do not edit or add to this file if you wish to upgrade MAGIX CMS to newer
# versions in the future. If you wish to customize MAGIX CMS for your
# needs please refer to http://www.magix-cms.com for more information.
*/
/**
* MAGIX CMS
* @category MODEL
* @package frontend
* @copyright MAGIX CMS Copyright (c) 2011 - 2012 Gerits Aurelien,
* http://www.magix-cms.com, http://www.magix-cjquery.com
* @license Dual licensed under the MIT or GPL Version 3 licenses.
* @version 1.0
* @author Gérits Aurélien <aurelien@magix-cms.com> <aurelien@magix-dev.be> | <gerits.aurelien@gmail.com>
* @name frontend_model_session
*
*/
class frontend_model_session
{
/**
* Nom de la session
* @var $session_name
*/
private $session_name;

/**
* Constructor
*/
public function __construct(){}

/**
* @access private
* Démarre une nouvelle session
*/
public function _start_session($session_name='magix_default_s'){
if(isset($session_name)){
if($session_name != 'adminlang'){
$name = $session_name;
}else{
$name = 'magix_default_s';
}
}
$string = $_SERVER['HTTP_USER_AGENT'];
$string .= 'SHIFLETT';
/* Add any other data that is consistent */
$fingerprint = md5($string);
//Fermeture de la première session, ses données sont sauvegardées.
session_write_close();
session_name($name);
ini_set('session.hash_function',1);
session_start();
}

/**
* initialise les variables de session
* @param array() $session
* @throws Exception
*/
private function ini_session_var($session){
if(is_array($session)) {
foreach($session as $row => $val) {
//if(!magixcjquery_filter_request::isSession($row)){
$_SESSION[$row] = $val;
/*}else{
$_SESSION[$row];
}*/
}
} else {
throw new Exception('session init is not array');
}
}

/**
* @access public
* Initialise la session ou renouvelle la session
* @param array $session_tabs
*/
public function session_run($session_tabs){
try {
//$lang = new frontend_model_IniLang();
//$lang->autoLangSession();
$this->ini_session_var($session_tabs);
} catch (Exception $e) {
$logger = new debug_logger(MP_LOG_DIR);
$logger->log('php', 'error', 'An error has occured : '.$e->getMessage(), debug_logger::LOG_MONTH);
}
}

/**
*
$session = new frontend_model_session();
if(!magixcjquery_filter_request::isSession('panier')){
$array_sess = array(
'panier'=>magixglobal_model_cryptrsa::uniq_id(),
'outils'=>'Le marteau du peuple'
);
$session->_start_session('masession');
$session->session_run($array_sess);
}else{
$session->debug();
frontend_model_template::assign('session_super', $_SESSION['panier']);
}
*/
/**
* @access public
* Affiche le debug pour les sessions
*/
public function debug(){
if (M_FIREPHP) {
$firebug = new magixcjquery_debug_magixfire();
$firebug->magixFireGroup('Magix Session');
//$firebug->magixFireLog($_SESSION);
$firebug->magixFireDump('session run',$_SESSION);
$firebug->magixFireGroupEnd();
}else{
var_dump($_SESSION);
}
}
}

0 comments on commit 8505df4

Please sign in to comment.