Source for file list.php
Documentation is available at list.php
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
* 'Home' module is used into the back-office
//////////// Check Inclusion de pages ////////////
include_once("../lib/lib_common.php");
if(defined('MOD_COMMENT') && MOD_COMMENT == 1) {
include_once(override('../comment/display.php'));
include_once(override('../comment/'. SQL. '.inc.php'));
include_once('../class/class.comment.php');
if(COMMENT_MODERATION == 1) {
$data = $comm->getAllByModule($status, $sql_object, false, 'date');
$nb_comments = count($data);
$data = $comm->getAllByModule($status, $sql_object, 10, 'date');
$nb_comments = count($data);
// workgroups users moderation
if(defined('MOD_WORKSHOP') && MOD_WORKSHOP == 1) {
include_once(override('../languages/'. U_L. '/lang_workshop.'. CHARSET. '.php'));
if ($r[0]['user_login']== "") $nb_pendingusers= 0;
else $nb_pendingusers = count($r);
$liste_pendingusers = '';
if ($nb_pendingusers != 0) {
for ($i = 0;$i < count($r);$i++ ) {
// we display only workgroups current user is in charge of
if ($l21auth->isWorkgroupOrganiser($l21auth->GetSessionElement('id'), $sql_object, $r[$i]['workshop_id']) || $l21auth->isSuperAdmin()){
$link_accept = '../workshop/_user.php?action=accept&id='. $r[$i]['workshop_id']. '&u_id='. $r[$i]['user_id'];
$link_revoke = '../workshop/_user.php?action=unaccept&id='. $r[$i]['workshop_id']. '&u_id='. $r[$i]['user_id'];
// we display user link only if admin
if($l21auth->isSuperAdmin()) {
$username = '<a href="?rub=user&todo=det&id='. $r[$i]['user_id']. '" title="' . $GLOBALS['links'][U_L]['user-profile']['desc']. '">'. $r[$i]['user_login']. '</a>';
$username = $r[$i]['user_login'];
if(!empty($r[$i]['profile_firstname']) || !empty($r[$i]['profile_lastname'])) {
$username .= ' ('. $r[$i]['profile_firstname']. '' . $r[$i]['profile_lastname'] . ')';
$username .= ' - <a href="mailto:'. $r[$i]['profile_email']. '">'. $r[$i]['profile_email']. '</a>';
// $liste_pendingusers .= "\t<li class=\"li2 to-moderate\">". formatText($username, '2HTML') . "<br />" .sprintf(_t('workshop', 'workshop_join'), formatText('<a href="?rub=workshop&todo=det&id='.$r[$i]['workshop_id'].'">'.$r[$i]['workshop_denomination'].'</a>', '2HTML')). "<a href=\"".$link_accept."\" title=\""._t('workshop','add_new_user')."\" class=\"ico_add user-action\"><i class=\"icon-ok\"></i><span>" . _t('workshop','del_user') . "</span></a><a href=\"".$link_revoke."\" title=\""._t('workshop','del_user')."\" class=\"ico_sup user-action\"><i class=\"icon-cancel\"></i><span>" . _t('workshop','del_user') . "</span></a></li>\n\n";
$liste_pendingusers .= "\t<li class=\"li2 to-moderate\"><div class=\"iconetab\"><a href=\"". $link_accept. "\" title=\"". _t('workshop','add_new_user'). "\" class=\"ico_approve user-action\"><i class=\"icon-ok\"></i><span>" . _t('workshop','add_new_user') . "</span></a><a href=\"". $link_revoke. "\" title=\"". _t('workshop','del_user'). "\" class=\"ico_sup user-action\"><i class=\"icon-cancel\"></i><span>" . _t('workshop','del_user') . "</span></a></div>". formatText($username, '2HTML') . "<br />" . sprintf(_t('workshop', 'workshop_join'), formatText('<a href="?rub=workshop&todo=det&id='. $r[$i]['workshop_id']. '">'. $r[$i]['workshop_denomination']. '</a>', '2HTML')). "</li>\n\n";
if(empty($liste_pendingusers)) $liste_pendingusers .= "\t<li><div class=\"info\">" . _t('home','noupdate'). "</div></li>\n\n";
$js = '$("a.user-action").click(function() {
var url = $(this).attr("href") + "&mode=ajax";
// we update the user counter
$("#cu").text( parseInt($("#cu").text()) - 1);
// humane.success = humane.spawn({ addnCls: "humane-jackedup-success"});
// humane.success(data.msg);
$(el).closest("li").fadeOut();
// humane.error = humane.spawn({ addnCls: "humane-jackedup-error"});
// humane.error(data.msg);
} else $liste_pendingusers .= "\t<li><div class=\"info\">" . _t('home','noupdate'). "</div></li>\n\n";
$result_yp = $sql_object -> DBSelect($req_yp);
if ($result_yp[0]['yellowp_id']== "") $nb_yp= 0;
else $nb_yp = count($result_yp);
$link_yp = "index.php?rub=yellowpages&todo=det&id=";
for ($i = 0;$i < count($result_yp);$i++ ) {
$liste_yp .= "\t<li class=\"li2\"><a href=\"" . $link_yp . $result_yp[$i]['yellowp_id'] . "\" title=\"" . formatText($result_yp[$i]['yellowp_name'], '2ATT') . "\">" . formatText($result_yp[$i]['yellowp_name'], '2HTML') . "</a></li>\n\n";
}else $liste_yp .= "\t<li><div class=\"info\">" . _t('home','noupdate'). "</div></li>\n\n";
$result_sdi = $sql_object -> DBSelect($req_sdi);
if ($result_sdi[0]['sdii_id']== "") $nb_dashboard= 0;
else $nb_dashboard = count($result_sdi);
$link_dashboard = "index.php?rub=dashboard&todo=det&id=";
for ($i = 0;$i < count($result_sdi);$i++ ) {
$liste_dashboard .= "\t<li class=\"li2\"><a href=\"" . $link_dashboard . $result_sdi[$i]['sdii_id'] . "&scale_id=" . $result_sdi[$i]['scale_id'] . "\" title=\"" . formatText($result_sdi[$i]['sdii_name'], '2ATT') . "\">" . formatText($result_sdi[$i]['sdii_name'], '2HTML') . "</a> <span class=\"scale\"> (" . formatText($result_sdi[$i]['scale_denomination'], '2HTML') . ") </span></li>\n\n";
}else $liste_dashboard .= "\t<li><div class=\"info\">" . _t('home','noupdate'). "</div></li>\n\n";
if (isset ($_SESSION['lastcon'])){
$resultu = $sql_object -> DBSelect($req_user);
if ($resultu[0]['user_id']== "") $nb_user= 0;
else $nb_user = count($resultu);
$link_user = "index.php?rub=user&todo=det&id=";
for ($i = 0;$i < count($resultu);$i++ ) {
if(!empty($resultu[$i]['profile_firstname']) || $resultu[$i]['profile_lastname']) {
$fullname = ' - '. $resultu[$i]['profile_firstname']. ' '. $resultu[$i]['profile_lastname'];
$liste_user .= "\t<li class=\"li2\"><a href=\"" . $link_user . $resultu[$i]['user_id'] . "\" title=\"" . formatText($resultu[$i]['user_login'], '2ATT') . "\">" . formatText($resultu[$i]['user_login'], '2HTML') . "</a>". $fullname. "</li>\n\n";
}else $liste_user .= "\t<li><div class=\"info\">" . _t('home','noupdate'). "</div></li>\n\n";
$result_news = $sql_object -> DBSelect($req_news);
if ($result_news[0]['news_id']== "") $nb_news= 0;
else $nb_news = count($result_news);
$link_news = "index.php?rub=news&todo=det&id=";
for ($i = 0;$i < count($result_news);$i++ ) {
$liste_news .= "\t<li class=\"li2\"><a href=\"" . $link_news . $result_news[$i]['news_id'] . "\" title=\"" . formatText($result_news[$i]['news_title'], '2ATT') . "\">" . formatText($result_news[$i]['news_title'], '2HTML') . "</a></li>\n\n";
} else $liste_news .= "\t<li><div class=\"info\">" . _t('home','noresult'). "</div></li>\n\n";
$result_publi = $sql_object -> DBSelect($req_publi);
$link_publi = "index.php?rub=publication&todo=det&id=";
if ($result_publi[0]['publi_id']== "") $nb_publi= 0;
else $nb_publi = count($result_publi);
if ($nb_publi<> 0) $liste_publi = "\t<li class=\"li2\"><a href=\"" . $link_publi . $result_publi[0]['publi_id'] . "\" title=\"" . formatText($result_publi[0]['publi_title'], '2HTML') . "\">" . formatText($result_publi[0]['publi_title'], '2HTML') . "</a></li>\n\n";
else $liste_publi = "\t<li><div class=\"info\">" . _t('home','noresult'). "</div></li>\n\n";
$result_rep = $sql_object -> DBSelect($req_rep);
if ($result_rep[0]['workrep_id']== "") $nb_rep= 0;
else $nb_rep = count($result_rep);
$link_rep = "index.php?rub=workshoprep&todo=det&id=";
if ($nb_rep<> 0) $liste_rep = "\t<li class=\"li2\"><a href=\"" . $link_rep . $result_rep[0]['workrep_id'] . "\" title=\"" . formatText($result_rep[0]['workrep_title'], '2ATT') . "\">" . formatText($result_rep[0]['workrep_title'], '2HTML') . "</a></li>\n\n";
else $liste_rep = "\t<li><div class=\"info\">" . _t('home','noresult'). "</div></li>\n\n";
if ($rProjects == 0) $nbProjects= 0;
else $nbProjects = count($rProjects);
$link_projects = "index.php?rub=project&todo=det&id=";
for ($i = 0;$i < count($rProjects);$i++ ) {
$lProjects .= "\t<li class=\"li2\"><a href=\"" . $link_projects . $rProjects[$i]->project_id . "\" title=\"" . formatText($rProjects[$i]->project_name, '2ATT') . "\">" . formatText($rProjects[$i]->project_name, '2HTML') . ' ('. $rProjects[$i]->project_estimated_date_display . ")</a></li>\n\n";
} else $lProjects .= "\t<li><div class=\"info\">" . _t('home','noresult'). "</div></li>\n\n";
<li><a href="index.php" class="chemin_home"> <?php echo _t('way','home') ?></a>
include_once(THEME_ADMIN_PATH. "quickicons.php");
<div class="contentcontainer"> <?php include_once(override($dir. '/menurub.php', THEME_ADMIN_PATH));
$listing .= "<div class=\"scale\">" . _t('home','accueil') . ": <a href=\"mailto:". MAIL_LINEA. "\" title=\"". MAIL_LINEA. "\">". MAIL_LINEA. "</a></div>";
$listing .= "<h2>" . _t('home','resume') . "</h2><br class=\"brendstep\" />";
if ($l21auth->isSuperAdmin() && defined('MOD_COMMENT') && MOD_COMMENT == 1) {
if($nb_comments > 0) $class= 'block';
$c = ($class == 'block') ? 'open' : '';
if(COMMENT_MODERATION == 1) {
$title = sprintf(_t('home','comment_to_moderate'), '<span id="cc">'. $nb_comments. '</span>');
$title = sprintf(_t('home','comment'), $nb_comments);
$listing .= "<div class=\"toggle_title\"><a href=\"#\" class=\"". $c . "\">" . $title. "</a></div>";
$listing .= "<div class=\"contboxgray\" id=\"comments\" style=\"display:". $class. ";\">\n";
if(!empty($html_comments)) $listing .= $html_comments;
else $listing .= "<div class=\"info\">". _t('home','noresult'). "</div>";
if ($l21auth->hasRight('workshop') && defined('MOD_WORKSHOP') && MOD_WORKSHOP == 1) {
if($cnt_pending_users > 0) $class= 'block';
$c = ($class == 'block') ? 'open' : '';
$title = sprintf(_t('home','workshop_pending_users'), '<span id="cu">'. $cnt_pending_users. '</span>');
$listing .= "<div class=\"toggle_title\"><a href=\"#\" class=\"". $c . "\">" . $title . "</a></div>";
$listing .= "<div class=\"contboxgray\" id=\"workgroup-users\" style=\"display:". $class. ";\">\n";
$listing .= $liste_pendingusers;
if ($l21auth->hasRight('dashboard') && defined('MOD_DASHBOARD') && MOD_DASHBOARD == 1) {
if($nb_dashboard > 0) $class= 'block';
$c = ($class == 'block') ? 'open' : '';
$listing .= "<div class=\"toggle_title\"><a href=\"#\" class=\"". $c . "\">" . $nb_dashboard . " " . _t('home','dashboard') . "</a></div>";
$listing .= "<div class=\"contboxgray\" id=\"general\" style=\"display:". $class. ";\">\n";
$listing .= $liste_dashboard;
if ($l21auth->isSuperAdmin() && defined('MOD_PROJECT') && MOD_PROJECT == 1) {
$listing .= "<div class=\"toggle_title\"><a href=\"#\">" . _t('home','project') . "</a></div>";
$listing .= "<div class=\"contboxgray\" id=\"projects\" style=\"display:none;\" >\n";
if ($l21auth->isSuperAdmin() && defined('MOD_USER') && MOD_USER == 1){
if($nb_user > 0) $class= 'block';
$listing .= "<div class=\"toggle_title\"><a href=\"#\" class=\"". $c . "\">" . $nb_user . " " . _t('home','user') . "</a></div>";
$listing .= "<div class=\"contboxgray\" id=\"user\" style=\"display:". $class. ";\">\n";
if ($l21auth->isSuperAdmin() && defined('MOD_YELLOWPAGES') && MOD_YELLOWPAGES == 1){
if($nb_yp > 0) $class= 'block';
$c = ($class == 'block') ? 'open' : '';
$listing .= "<div class=\"toggle_title\"><a href=\"#\" class=\"". $c . "\">" . $nb_yp . " " . _t('home','yp') . "</a></div>";
$listing .= "<div class=\"contboxgray\" id=\"yp\" style=\"display:". $class. ";\">\n";
if ($l21auth->hasRight('news') && defined('MOD_NEWS') && MOD_NEWS == 1){
$listing .= "<h3>" . _t('home','news') . "</h3>";
$listing .= "<div class=\"contboxgray\">\n";
if ($l21auth->hasRight('publication') && defined('MOD_PUBLICATION') && MOD_PUBLICATION == 1) {
$listing .= "<h3>" . _t('home','publi') . "</h3>";
$listing .= "<div class=\"contboxgray\">\n";
$listing .= $liste_publi;
$listing .= "<div class=\"scale\">" . formatText($result_publi[0]['publi_resume'], '2HTML') . "</div>";
if ($l21auth->hasRight('workshop') && defined('MOD_WORKSHOP') && MOD_WORKSHOP == 1) {
$listing .= "<h3>" . _t('home','report') . "</h3>";
$listing .= "<div class=\"contboxgray\">\n";
$listing .= "<div class=\"scale\">" . formatText($result_rep[0]['workrep_resume'], '2HTML') . "</div>";
<?php include_once(override($dir. '/help.php', THEME_ADMIN_PATH)); ?></div>
|