X-Git-Url: http://git.cyclocoop.org/?p=velocampus%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Finc%2Fmeme_rubrique.php;fp=www%2Fecrire%2Finc%2Fmeme_rubrique.php;h=e3ddc9f5d57763fd0d6b787add75d73e6b26f185;hp=0000000000000000000000000000000000000000;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c diff --git a/www/ecrire/inc/meme_rubrique.php b/www/ecrire/inc/meme_rubrique.php new file mode 100644 index 0000000..e3ddc9f --- /dev/null +++ b/www/ecrire/inc/meme_rubrique.php @@ -0,0 +1,99 @@ +'articles','breve'=>'breves_voir','syndic'=>'sites'); + + $where = (($GLOBALS['visiteur_session']['statut'] == '0minirezo') + ? '' + : "(statut = 'publie' OR statut = 'prop') AND ") + . "id_rubrique=$id_rubrique AND ($prim != $id)"; + + $select = "$prim AS id, $titre AS titre, statut"; + + $n = sql_countsel($table, $where); + + if (!$n) return ''; + + if (!defined('_TRI_ARTICLES_RUBRIQUE')) define('_TRI_ARTICLES_RUBRIQUE', 'date DESC'); // surcharge possible dans mes_options.php + $order = ($order == '') ? _TRI_ARTICLES_RUBRIQUE : "$order DESC"; + $voss = sql_select($select, $table, $where, '', "$order", $limit); + + $limit = $n - $limit; + $retour = ''; + $puce_statut = charger_fonction('puce_statut', 'inc'); + $idom = 'rubrique_' . $type; + + while($row = sql_fetch($voss)) { + $id = $row['id']; + $num = afficher_numero_edit($id, $prim, $type); + $statut = $row['statut']; + + // Exception pour les meme-rubrique de sites + if ($type == "syndic") $type_statut = "site"; + else $type_statut = $type; + + $statut = $puce_statut($id, $statut, $id_rubrique, $type_statut); + $href = "" + . sinon(typo($row['titre']), _T('info_sans_titre')) + . ""; + + // Todo: refaire en css plus sains + $retour .= "\n
" + . "\n
" + . $num . "
" + . "
".$statut ."
" + . "
".$href."
" + . "
" + . "
"; + } + + $icone = '' . _T('info_meme_rubrique') . ''; + $bouton = bouton_block_depliable(_T('info_meme_rubrique'),true,'memerub'); + + $retour = + debut_cadre('meme-rubriques',"article-24.gif",'',$bouton) + . debut_block_depliable(true,'memerub') + . $retour; + + + // $retour .= (($limit <= 0) ? '' : "+ $limit"); + + $retour .= fin_block() + . fin_cadre('meme-rubriques'); + + if ($ajax) return $retour; + + // id utilise dans puce_statut_article + return "\n
$retour
"; +} +?>