function barre_onglets($rubrique, $ongletCourant, $class = "barre_onglet") { include_spip('inc/presentation'); $res = ''; foreach (definir_barre_onglets($rubrique) as $exec => $onglet) { $url = $onglet->url ? $onglet->url : generer_url_ecrire($exec); $res .= onglet(_T($onglet->libelle), $url, $exec, $ongletCourant, $onglet->icone); } return !$res ? '' : debut_onglet($class) . $res . fin_onglet(); }
function ckeditor_barre_onglets($rubrique, $ongletCourant, $class="barre_onglet"){ include_spip('inc/presentation'); include_spip('inc/ckeditor_constantes') ; $res = ''; $cpt = 0 ; foreach(definir_barre_onglets($rubrique) as $exec => $onglet) { if ($cpt==_CKE_MAX_ONGLETS) { $cpt = 0 ; $res .= '</tr><tr>' ; } else { $cpt++ ; } $url= $onglet->url ? $onglet->url : generer_url_ecrire($exec); $res .= onglet(_T($onglet->libelle), $url, $exec, $ongletCourant, $onglet->icone); } return !$res ? '' : (debut_onglet($class) . $res . fin_onglet()); }
$list_alpha[$car] = $car; if (!isset($first)) { $first = $car; } } } if (!isset($list_alpha[$protectedPost['onglet']])) { $protectedPost['onglet'] = $first; } $_SESSION['OCS']['REQ_ONGLET_SOFT'] = $sql_list_alpha; $_SESSION['OCS']['ONGLET_SOFT'] = $list_alpha; } $form_name = "all_soft"; $table_name = "all_soft"; echo open_form($form_name); onglet($_SESSION['OCS']['ONGLET_SOFT'], $form_name, "onglet", 20); echo '<div class="mlt_bordure" >'; if (isset($protectedPost['NAME_RESTRICT']) and $protectedPost['NAME_RESTRICT'] != "" or isset($protectedPost['NBRE']) and $protectedPost['NBRE'] != "") { msg_warning($l->g(767)); } //use cache if ($_SESSION['OCS']["usecache"] == 1 and !(isset($_SESSION['OCS']['USE_NEW_SOFT_TABLES']) and $_SESSION['OCS']['USE_NEW_SOFT_TABLES'] == 1)) { $search_soft['SQL'] = "select name,id from softwares_name_cache"; //$forcedRequest['SQL']=$search_soft['SQL']; $search_soft['SQL'] .= " where name like '%s'"; $search_soft['ARG'] = array($protectedPost['onglet'] . "%"); $and_where = " where "; if (isset($protectedPost['NAME_RESTRICT']) and $protectedPost['NAME_RESTRICT'] != "") { //$forcedRequest['SQL'].= $and_where." name like '%s' "; //$forcedRequest['ARG']=array("%".$protectedPost['NAME_RESTRICT']."%"); $search_soft['SQL'] .= " and name like '%s' ";
/** * Affichage spécifique de la page de gestion des plugins * * Affiche la liste des plugins demandés et les erreurs éventuelles. * * @uses plugin_donne_erreurs() * @uses liste_chemin_plugin() * @uses plugin_installes_meta() * @uses affiche_les_plugins_verrouilles() * * @pipeline_appel affiche_gauche * @pipeline_appel affiche_droit * @pipeline_appel affiche_milieu * * @param string $quoi * Quels plugins afficher ? actifs, ou autre * @param string $erreur * Erreur éventuelle à afficher * @param string $format * Format d'affichage (liste ou arborescence) **/ function admin_plug_args($quoi, $erreur, $format) { if (!$quoi) { $quoi = 'actifs'; } // empecher l'affichage des erreurs dans le bandeau, on le donne ensuite // format brut par plugin $GLOBALS['erreurs_activation_raw'] = plugin_donne_erreurs(true, false); // format resume mis en forme $erreur_activation = plugin_donne_erreurs(); $commencer_page = charger_fonction('commencer_page', 'inc'); echo $commencer_page(_T('icone_admin_plugin'), "configuration", "plugin"); echo debut_gauche('plugin', true); echo recuperer_fond('prive/squelettes/navigation/configurer', array('exec' => 'admin_plugin')); echo pipeline('affiche_gauche', array('args' => array('exec' => 'admin_plugin'), 'data' => afficher_librairies())); echo debut_droite('plugin', true); echo gros_titre(_T('icone_admin_plugin'), '', false); // Barre d'onglets de premier niveau echo barre_onglets("plugins", "plugins_actifs"); // Barre d'onglets de second niveau $onglet2 = $quoi == 'actifs' ? 'plugins_actifs' : 'admin_plugin'; echo debut_onglet('onglets_simple second'); echo onglet(_T('plugins_tous_liste'), generer_url_ecrire("admin_plugin", "voir=tous"), 'admin_plugin', $onglet2); echo onglet(_T('plugins_actifs_liste'), generer_url_ecrire("admin_plugin"), 'plugins_actifs', $onglet2); echo fin_onglet(); // message d'erreur au retour d'une operation if ($erreur) { echo "<div class='error'>{$erreur}</div>"; } if ($erreur_activation) { echo "<div class='error'>{$erreur_activation}</div>"; } // la mise a jour de cette meta a ete faite par ecrire_plugin_actifs $actifs = unserialize($GLOBALS['meta']['plugin']); $lcpa = $actifs + unserialize($GLOBALS['meta']['plugin_attente']); // Les affichages se basent sur le repertoire, pas sur le nom $actifs = liste_chemin_plugin($actifs, ''); if (defined('_DIR_PLUGINS_SUPPL')) { $lcpas = liste_chemin_plugin($lcpa, _DIR_PLUGINS_SUPPL); } $lcpa = liste_chemin_plugin($lcpa); // on installe les plugins maintenant, // cela permet aux scripts d'install de faire des affichages (moches...) plugin_installes_meta(); echo "<div class='liste-plugins formulaire_spip'>"; echo debut_cadre_trait_couleur('plugin-24.png', true, '', _T('plugins_liste'), 'plugins'); if ($quoi !== 'actifs') { $lpf = liste_plugin_files(); if ($lpf) { echo "<p>" . _T('texte_presente_plugin') . "</p>"; } else { if (!@is_dir(_DIR_PLUGINS)) { echo "<p>" . _T('plugin_info_automatique_ftp', array('rep' => joli_repertoire(_DIR_PLUGINS))) . " — " . _T('plugin_info_automatique_creer') . "</p>"; } } $lcpaffiche = $lpf; if (defined('_DIR_PLUGINS_SUPPL')) { $lcpaffichesup = liste_plugin_files(_DIR_PLUGINS_SUPPL); } } else { // la liste // $quoi=='actifs' $lcpaffiche = $lcpa; if (defined('_DIR_PLUGINS_SUPPL')) { $lcpaffichesup = $lcpas; } } if ($quoi == 'actifs' or $lpf) { $nb = count($lcpa); if (defined('_DIR_PLUGINS_SUPPL')) { $nb += count($lcpas); } echo "<h3>" . sinon(singulier_ou_pluriel($nb, 'plugins_actif_un', 'plugins_actifs', 'count'), _T('plugins_actif_aucun')) . "</h3>"; } if (empty($format)) { $format = 'liste'; } elseif (!in_array($format, array('liste', 'repertoires'))) { $format = 'repertoires'; } $afficher = charger_fonction("afficher_{$format}", 'plugins'); $corps = $afficher(self(), $lcpaffiche, $lcpa, $actifs); if (defined('_DIR_PLUGINS_SUPPL')) { $corps .= $afficher(self(), $lcpaffichesup, $lcpas, $actifs, _DIR_PLUGINS_SUPPL); } if ($corps) { $corps .= "\n<div class='boutons' style='display:none;'>" . "<input type='submit' class='submit save' value='" . _T('bouton_enregistrer') . "' />" . "</div>"; } echo redirige_action_post('activer_plugins', 'activer', 'admin_plugin', '', $corps); echo fin_cadre_trait_couleur(true); if ($quoi == 'actifs') { echo affiche_les_plugins_verrouilles($actifs); } echo "</div>"; echo http_script("\n\tjQuery(function(){\n\t\tjQuery('.plugins li.item a[rel=info]').click(function(){\n\t\t\tvar li = jQuery(this).parents('li').eq(0);\n\t\t\tvar prefix = li.find('input.checkbox').attr('name');\n\t\t\tif (!jQuery('div.details',li).html()) {\n\t\t\t\tjQuery('div.details',li).prepend(ajax_image_searching).load(\n\t\t\t\t\tjQuery(this).attr('href').replace(/admin_plugin|plugins/, 'info_plugin'), function(){\n\t\t\t\t\t\tli.addClass('on');\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (jQuery('div.details',li).toggle().is(':visible'))\n\t\t\t\t\tli.addClass('on');\n\t\t\t\telse\n\t\t\t\t\tli.removeClass('on');\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tjQuery('.plugins li.item input.checkbox').change(function(){\n\t\t\tjQuery(this).parents('form').eq(0).find('.boutons').slideDown();\n\t\t});\n\t});\n\t"); echo pipeline('affiche_milieu', array('args' => array('exec' => 'admin_plugin'), 'data' => '')); echo fin_gauche(), fin_page(); }
$form_name = 'groups'; echo open_form($form_name); //view all groups if ($_SESSION['OCS']['CONFIGURATION']['GROUPS'] == "YES") { $def_onglets['DYNA'] = $l->g(810); //Dynamic group $def_onglets['STAT'] = $l->g(809); //Static group centraux if ($_SESSION['OCS']["use_redistribution"] == 1) { $def_onglets['SERV'] = mb_strtoupper($l->g(651)); } if ($protectedPost['onglet'] == "") { $protectedPost['onglet'] = "STAT"; } //show onglet onglet($def_onglets, $form_name, "onglet", 0); echo '<div class="mlt_bordure" >'; } else { $protectedPost['onglet'] = "STAT"; } $list_fields = array('GROUP_NAME' => 'h.NAME', 'GROUP_ID' => 'h.ID', 'DESCRIPTION' => 'h.DESCRIPTION', 'CREATE' => 'h.LASTDATE', 'NBRE' => 'NBRE'); //only for admins if ($_SESSION['OCS']['CONFIGURATION']['GROUPS'] == "YES") { if ($protectedPost['onglet'] == "STAT") { $list_fields['CHECK'] = 'ID'; } $list_fields['SUP'] = 'ID'; $tab_options['LBL_POPUP']['SUP'] = 'NAME'; $tab_options['LBL']['SUP'] = $l->g(122); } //changement de nom � l'affichage des champs
if (isset($action_updown)) { $new_order = find_new_order($action_updown, $protectedPost[$action_updown], 'SNMP', $protectedPost['onglet']); if ($new_order) { // $array_info_account=find_info_accountinfo($new_order['NEW']); update_accountinfo_config($new_order['OLD'], array('SHOW_ORDER' => $new_order['NEW_VALUE'])); update_accountinfo_config($new_order['NEW'], array('SHOW_ORDER' => $new_order['OLD_VALUE'])); } } //print_r($info_account_id); if (!isset($protectedPost['onglet']) or $protectedPost['onglet'] == '' or !is_numeric($protectedPost['onglet'])) { $protectedPost['onglet'] = $list_tab['FIRST']; } unset($list_tab['FIRST']); echo "<br>"; echo open_form($form_name); onglet($list_tab, $form_name, "onglet", 6); echo '<div class="mlt_bordure" >'; if ($_SESSION['OCS']['profile']->getConfigValue('ACCOUNTINFO') == 'YES') { $show_admin_button = "<a href=# OnClick='pag(\"ADMIN\",\"ADMIN\",\"" . $form_name . "\");'>"; if (isset($_SESSION['OCS']['ADMIN']['ACCOUNTINFO'])) { $show_admin_button .= "<img src='image/success.png'></a>"; } else { $show_admin_button .= "<img src='image/modif_tab.png'></a>"; } } else { $show_admin_button = ''; } $sql_admin_info = "select ID,TYPE,NAME,COMMENT,NAME_ACCOUNTINFO,SHOW_ORDER from accountinfo_config where ID_TAB = %s and account_type='SNMP'\n\t\t\t\t\t\torder by SHOW_ORDER ASC"; $arg_admin_info = array($protectedPost['onglet']); $res_admin_info = mysql2_query_secure($sql_admin_info, $_SESSION['OCS']["readServer"], $arg_admin_info); $num_row = mysqli_num_rows($res_admin_info);
function dde_conf($form_name) { global $l, $protectedPost, $protectedGet, $pages_refs, $infos_status; if ($_SESSION['OCS']['CONFIGURATION']['TELEDIFF_WK'] == 'YES') { //sous onglets if ($infos_status['NIV_BIS'] != '') { $conf_value['GENERAL'] = $l->g(107); $conf_value['GUI'] = $l->g(84); } $conf_value['STATUS'] = $l->g(1095); //$conf_value['ADMIN']='Administration'; onglet($conf_value, $form_name, "conf", 7); if ($protectedPost['Valid'] == $l->g(103)) { $etat = verif_champ(); if ($etat == "") { $MAJ = update_default_value($protectedPost); } else { $msg = ""; foreach ($etat as $name => $value) { $msg .= $name . " " . $l->g(759) . " " . $value . "<br>"; } msg_error($msg); } } if (!isset($protectedPost['conf']) or $protectedPost['conf'] == "GENERAL") { pageTELEDIFF_WK($form_name); } if ($protectedPost['conf'] == "GUI") { //mise a jour des données demandée par l'utilisateur if ($protectedPost['Valid_fields_x'] != "") { //si la mise a jour est limitée à certain champs if (isset($protectedPost['DEFAULT_FIELD'])) { $fields = explode(',', $protectedPost['DEFAULT_FIELD']); } else { $fields = array('type', 'field', 'lbl', 'must_completed', 'value', 'restricted', 'link_status'); //si le type est TEXTAREA, il faut aussi changer le type de la colonne en longtext if ($protectedPost['type'] == 1) { $type_modif = "longtext"; } else { $type_modif = "varchar(255)"; } $sql_modify_type = 'ALTER TABLE downloadwk_pack change fields_%1$s fields_%1$s ' . $type_modif . ' default null;'; $arg = array($protectedPost['FIELDS']); mysql2_query_secure($sql_modify_type, $_SESSION['OCS']["writeServer"], $arg); //echo $sql_modify_type; } //création de la requête $sql_update = 'UPDATE downloadwk_fields set '; $arg = array(); foreach ($fields as $key => $value) { $sql_update .= $value . "='%s' ,"; $arg[] = $protectedPost[$value]; } $sql_update = substr($sql_update, 0, -1) . "where id='%s'"; $arg[] = $protectedPost['FIELDS']; mysql2_query_secure($sql_update, $_SESSION['OCS']["writeServer"], $arg); //print_r //echo $sql_update; } $sql_service = "select id,field,value,lbl,default_field \n\t\t\t\t\t\t\t FROM downloadwk_tab_values"; $resultSERV = mysql2_query_secure($sql_service, $_SESSION['OCS']["readServer"]); $List_tab[] = ''; while ($item = mysql_fetch_object($resultSERV)) { $lbl = define_lbl($item->lbl, $item->default_field); $List_tab[$item->id] = $lbl; } $name_field = array("TAB"); //$oblig_field['INFO_VALID']=$name_field['INFO_VALID']; $tab_name = array($l->g(1097) . ":"); $type_field = array(2); $value_field = array($List_tab); if (isset($protectedPost['TAB']) and $protectedPost['TAB'] != 0) { $sql_service = "select id,lbl,default_field \n\t\t\t\t\t\t\t\t FROM downloadwk_fields \n\t\t\t\t\t\t\t\t where TAB='%s'"; $arg = array($protectedPost['TAB']); $resultSERV = mysql2_query_secure($sql_service, $_SESSION['OCS']["readServer"], $arg); $List_fields[] = ''; while ($item = mysql_fetch_object($resultSERV)) { $lbl = define_lbl($item->lbl, $item->default_field); $List_fields[$item->id] = $lbl; $default_field[$item->id] = $item->default_field; } array_push($name_field, "FIELDS"); array_push($tab_name, $l->g(1096) . ":"); array_push($type_field, 2); array_push($value_field, $List_fields); } $tab_typ_champ = show_field($name_field, $type_field, $value_field); $tab_typ_champ[0]['COMMENT_BEHING'] = "<a href=# onclick=window.open(\"index.php?" . PAG_INDEX . "=" . $pages_refs['ms_admin_management'] . "&head=1&admin=tab&value=TAB&form=" . $form_name . "\",\"admin_management\",\"location=0,status=0,scrollbars=0,menubar=0,resizable=0,width=550,height=450\")><img src=image/plus.png></a>"; $tab_typ_champ[0]['RELOAD'] = $form_name; $tab_typ_champ[1]['RELOAD'] = $form_name; $tab_typ_champ[1]['COMMENT_BEHING'] = "<a href=# onclick=window.open(\"index.php?" . PAG_INDEX . "=" . $pages_refs['ms_admin_management'] . "&head=1&admin=fields&value=" . $protectedPost['TAB'] . "&form=" . $form_name . "\",\"admin_management\",\"location=0,status=0,scrollbars=0,menubar=0,resizable=0,width=700,height=650\")><img src=image/plus.png></a>"; tab_modif_values($tab_name, $tab_typ_champ, $tab_hidden, $title = "", $comment = "", $name_button = "modif", $showbutton = false, $form_name = 'NO_FORM'); if (isset($protectedPost['FIELDS']) and $protectedPost['FIELDS'] != 0) { echo "<br>"; $sql_status = "SELECT id,lbl FROM downloadwk_statut_request"; $res_status = mysql2_query_secure($sql_status, $_SESSION['OCS']["readServer"]); $status['0'] = $l->g(454); while ($val_status = mysql_fetch_array($res_status)) { $status[$val_status['id']] = $val_status['lbl']; } //print_r($status); $list_type = array('TEXT', 'TEXTAREA', 'SELECT', 'SHOW DATA', 'PASSWORD', 'CHECKBOX', 'LIST', 'HIDDEN', 'BLOB (FILE)', 'LINK LIST', 'TABLE'); $yes_no = array($l->g(454), $l->g(455)); $sql_detailField = "select type,field,lbl,must_completed,\n\t\t\t\t\t\t\t\t\t\tvalue,restricted,link_status \n\t\t\t\t\t\t\t\t\t FROM downloadwk_fields \n\t\t\t\t\t\t\t\t\t where id='%s' and tab='%s' "; $arg = array($protectedPost['FIELDS'], $protectedPost['TAB']); $result_detailField = mysql2_query_secure($sql_detailField, $_SESSION['OCS']["readServer"], $arg); $item_detailField = mysql_fetch_object($result_detailField); //if there is no result or more than 1, don't show update table $num_row = mysql_numrows($result_detailField); if ($num_row == 1) { $protectedPost['type'] = $item_detailField->type; $protectedPost['must_completed'] = $item_detailField->must_completed; $protectedPost['restricted'] = $item_detailField->restricted; $protectedPost['link_status'] = $item_detailField->link_status; $name_field = array('type', 'field', 'lbl', 'must_completed', 'value', 'restricted', 'link_status'); $tab_name = array($l->g(1071) . ':', $l->g(1098) . ':', $l->g(1063) . ':', $l->g(1064) . ':', $l->g(1099) . ':', $l->g(1065) . ':', $l->g(1066) . ':'); if ($default_field[$protectedPost['FIELDS']]) { $title = $l->g(1101); //$showbutton=false; $type_field = array(3, 3, 3, 3, 0, 3, 3, 7); $value_field = array($list_type[$item_detailField->type], $item_detailField->field, $l->g($item_detailField->lbl), $yes_no[$item_detailField->must_completed], $item_detailField->value, $yes_no[$item_detailField->restricted], $status[$item_detailField->link_status], 'value'); if ($item_detailField->field == "STATUS") { $type_field[4] = 2; unset($status[0]); $value_field[4] = $status; $protectedPost['value'] = $item_detailField->value; } $name_field[7] = 'DEFAULT_FIELD'; $tab_name[7] = ''; } else { $title = ""; //$showbutton=true; $type_field = array(2, 0, 0, 2, 0, 2, 2); $value_field = array($list_type, $item_detailField->field, $item_detailField->lbl, $yes_no, $item_detailField->value, $yes_no, $status); } $tab_typ_champ = show_field($name_field, $type_field, $value_field); tab_modif_values($tab_name, $tab_typ_champ, $tab_hidden, $title, $comment = "", $name_button = "fields", $showbutton = true, $form_name = 'NO_FORM'); } } } elseif ($protectedPost['conf'] == "STATUS") { //mise à jour des valeurs de statuts if ($protectedPost['Valid_fields_x'] != '') { if (trim($protectedPost['lbl']) != '') { $sql_update = "UPDATE downloadwk_statut_request\n\t\t\t\t\t\t\t\t\t\tset LBL='%s' , ACTIF='%s'\n\t\t\t\t\t\t\t\t\t\twhere ID='%s'"; $arg = array($protectedPost['lbl'], $protectedPost['actif'], $protectedPost['id']); mysql2_query_secure($sql_update, $_SESSION['OCS']["writeServer"], $arg); msg_success($l->g(1121)); } else { msg_error($l->g(988)); } } $infos_status = list_status(false); $name_field = array("STATUS"); $tab_name = array($l->g(1100) . ":"); $type_field = array(2); $value_field = array($infos_status['STAT']); if (isset($protectedPost['STATUS']) and $protectedPost['STATUS'] != 0) { //delete old post if you change status if (isset($protectedPost['OLD_STATUS']) and $protectedPost['OLD_STATUS'] != $protectedPost['STATUS']) { unset($protectedPost['actif'], $protectedPost['lbl'], $protectedPost['name']); } $yes_no = array($l->g(454), $l->g(455)); if (!isset($protectedPost['actif'])) { $protectedPost['actif'] = $infos_status['ACTIF'][$protectedPost['STATUS']]; } if (!isset($protectedPost['lbl'])) { $protectedPost['lbl'] = $infos_status['STAT_BIS'][$protectedPost['STATUS']]; } if (!isset($protectedPost['name'])) { $protectedPost['name'] = $infos_status['NIV'][$protectedPost['STATUS']]; } $protectedPost['id'] = $protectedPost['STATUS']; array_push($name_field, 'actif', 'id', 'lbl', 'name', 'OLD_STATUS'); array_push($tab_name, $l->g(1102) . ':', $l->g(1103) . ':', $l->g(1063) . ':', $l->g(1064) . ':', ''); array_push($type_field, 2, 3, 0, 3, 7); array_push($value_field, $yes_no, $protectedPost['id'], $protectedPost['lbl'], $protectedPost['name'], $protectedPost['STATUS']); $showbutton = true; } else { $showbutton = false; } $tab_typ_champ = show_field($name_field, $type_field, $value_field); $tab_typ_champ[0]['RELOAD'] = $form_name; tab_modif_values($tab_name, $tab_typ_champ, $tab_hidden, $title, $comment = "", $name_button = "fields", $showbutton, $form_name = 'NO_FORM'); } } }
function controle_petition_onglet($id_article, $debut, $type, $arg='') { $arg .= ($id_article ? "id_article=$id_article&" :''); $arg2 = ($debut ? "debut=$debut&" : ''); if ($type=='public') { $argp = $arg2; $argi = ''; } else { $argi = $arg2; $argp = ''; } return debut_onglet() . onglet(_T('titre_signatures_confirmees'), generer_url_ecrire('controle_petition', $argp . $arg . "type=public"), "public", $type=='public', "forum-public-24.gif") . onglet(_T('titre_signatures_attente'), generer_url_ecrire('controle_petition', $argi . $arg . "type=interne"), "interne", $type=='interne', "forum-interne-24.gif") . fin_onglet() . '<br />'; }
$i++; } } //execute the query only if necessary $_SESSION['OCS']['REQ_ONGLET_SOFT'] = $sql_list_alpha; $_SESSION['OCS']['ONGLET_SOFT'] = $list_alpha; $_SESSION['OCS']['FIRST_DICO'] = $first; /* MG }else{ $list_alpha=$_SESSION['OCS']['ONGLET_SOFT']; } */ if (!isset($protectedPost['onglet_soft'])) { $protectedPost['onglet_soft'] = $_SESSION['OCS']['FIRST_DICO']; } onglet($list_alpha, $form_name, "onglet_soft", 20); //search all soft for the tab as selected /* MG $search_soft="select distinct name from ".$table." cache where name like '".$_SESSION['OCS']['ONGLET_SOFT'][$protectedPost['onglet_soft']]."%' and name not in (".$list_dico_soft.") and name not in (".$list_ignored_soft.") ".$search_cache; */ $search_soft = "select distinct trim(name) name from " . $table . " cache\n where name like '" . $_SESSION['OCS']['ONGLET_SOFT'][$protectedPost['onglet_soft']] . "%'\n and name not in (select extracted name from dico_soft)\n and name not in (select extracted name from dico_ignored) " . $search_cache; $result_search_soft = mysqli_query($_SESSION['OCS']["readServer"], $search_soft); $list_soft = "'"; while ($item_search_soft = mysqli_fetch_object($result_search_soft)) { $list_soft .= addslashes($item_search_soft->name) . "','"; } $list_soft = substr($list_soft, 0, -2); if ($list_soft == "") {
function barre_onglets($rubrique, $ongletCourant){ $res = ''; foreach(definir_barre_onglets($rubrique) as $exec => $onglet) { $url= $onglet->url ? $onglet->url : generer_url_ecrire($exec); $res .= onglet(_T($onglet->libelle), $url, $exec, $ongletCourant, $onglet->icone); } return !$res ? '' : (debut_onglet() . $res . fin_onglet()); }
function barre_onglets() { // determiner les onglets a cacher et a mettre en surbrillance if ($onglets = lister_onglets_cfg()) { foreach ($onglets as $fonds => $ong) { $o = $ong['onglet']; // onglet actif if ($o == 'oui') { $ong['actif'] = $fonds == _request('cfg'); } // rendre actif un parent si l'enfant est actif (onglet=nom_du_parent // (/!\ ne pas le desactiver s'il a deja ete mis actif) if ($o && $o != 'oui' && $o != 'non') { if (!isset($onglets[$o])) { $onglets[$o] = array(); } if (!isset($onglets[$o]['enfant_actif'])) { $onglets[$o]['enfant_actif'] = false; } $onglets[$o]['enfant_actif'] = ($onglets[$o]['enfant_actif'] or $fonds == _request('cfg')); } } } // retourner le code des onglets selectionnes $res = ""; if ($onglets) { $res = debut_onglet(); $n = -1; foreach ($onglets as $titre => $args) { if ($args['afficher']) { // Faire des lignes s'il y en a effectivement plus de 6 if (!(++$n % 6) && $n > 0) { $res .= fin_onglet() . debut_onglet(); } $res .= onglet($args['titre'], $args['url'], 'cfg', $args['actif'] || $args['enfant_actif'], $args['icone']); } } $res .= fin_onglet(); } return $res; }
unset($list_lbl[$key]); } } foreach ($list_lbl as $key => $value) { if (substr($value, 0, 2) == 'g(') { unset($list_lbl[$key]); $list_lbl[$key] = $l->g(substr(substr($value, 2), 0, -1)); } } //par défaut, on affiche les données admininfo /*if (!isset($protectedGet['option'])){ $protectedGet['option']="cd_admininfo"; }*/ echo "<br>"; echo open_form($form_name); onglet($list_lbl, $form_name, "onglet_sd", 10); $msq_tab_error = '<small>N/A</small>'; echo '<div class="mlt_bordure" >'; if (isset($list_lbl[$protectedPost['onglet_sd']])) { if (file_exists($Directory . "/" . $protectedPost['onglet_sd'] . "/" . $protectedPost['onglet_sd'] . ".php")) { // $protectedPost['computersectionrequest']=$protectedPost['onglet_sd']; include $Directory . "/" . $protectedPost['onglet_sd'] . "/" . $protectedPost['onglet_sd'] . ".php"; } } echo "</div>"; echo close_form(); if ($ajax) { ob_end_clean(); } /*$i=0; echo "<br><br><table width='90%' border=0 align='center'><tr align=center>";
$table_name = "registry"; echo open_form($form_name); if (isset($protectedPost['MODIF']) and $protectedPost['MODIF'] != '') { $protectedPost['tab'] = 'ADD'; $sql = "select NAME,REGTREE,REGKEY,REGVALUE,ID from regconfig where id = '%s'"; $arg = $protectedPost['MODIF']; //$sql="select NAME,ID,MASK from subnet where netid='".$netid."'"; $res = mysql2_query_secure($sql, $_SESSION['OCS']["readServer"], $arg); $row = mysql_fetch_object($res); $protectedPost['NAME'] = $row->NAME; $protectedPost['REGTREE'] = $row->REGTREE; $protectedPost['REGKEY'] = $row->REGKEY; $protectedPost['REGVALUE'] = $row->REGVALUE; $tab_hidden['id'] = $row->ID; } onglet($tab, $form_name, "tab", 4); echo '<div class="mlt_bordure" >'; if ($protectedPost['tab'] == 'VIEW') { // delete register key if (isset($protectedPost['SUP_PROF']) and $protectedPost['SUP_PROF'] != '') { // delete one row delkey($protectedPost['SUP_PROF']); $tab_options['CACHE'] = 'RESET'; } else { if (isset($protectedPost['del_check']) and $protectedPost['del_check'] != '') { // delete multiple selected rows $ids = explode(',', $protectedPost['del_check']); foreach ($ids as $id) { delkey($id); } $tab_options['CACHE'] = 'RESET';
function admin_profil($form) { global $protectedPost, $l, $pages_refs; $yes_no = array('YES' => $l->g(455), 'NO' => $l->g(454)); $info_field = array('NAME' => array('INFO' => array('LBL' => $l->g(1153) . ": ", 'VALUE' => '')), 'GUI' => array('RESTRICTION' => array('LBL' => $l->g(1154) . ": ", 'VALUE' => $yes_no)), 'TELEDIFF_ACTIVATE' => array('RESTRICTION' => array('LBL' => $l->g(1158) . ": ", 'VALUE' => $yes_no)), 'TELEDIFF_VISIBLE' => array('RESTRICTION' => array('LBL' => $l->g(1301) . ": ", 'VALUE' => $yes_no)), 'EXPORT_XML' => array('RESTRICTION' => array('LBL' => $l->g(1305), 'VALUE' => $yes_no)), 'WOL' => array('RESTRICTION' => array('LBL' => $l->g(1281) . ": ", 'VALUE' => $yes_no)), 'MACADD' => array('ADMIN_BLACKLIST' => array('LBL' => $l->g(1159) . ": ", 'VALUE' => $yes_no)), 'SERIAL' => array('ADMIN_BLACKLIST' => array('LBL' => $l->g(1160) . ": ", 'VALUE' => $yes_no)), 'IPDISCOVER' => array('ADMIN_BLACKLIST' => array('LBL' => $l->g(1161) . ": ", 'VALUE' => $yes_no), 'CONFIGURATION' => array('LBL' => $l->g(1172) . ": ", 'VALUE' => $yes_no)), 'TELEDIFF' => array('CONFIGURATION' => array('LBL' => $l->g(1162) . ": ", 'VALUE' => $yes_no)), 'CONFIG' => array('CONFIGURATION' => array('LBL' => $l->g(1163) . ": ", 'VALUE' => $yes_no)), 'GROUPS' => array('CONFIGURATION' => array('LBL' => $l->g(1164) . ": ", 'VALUE' => $yes_no)), 'CONSOLE' => array('CONFIGURATION' => array('LBL' => $l->g(1165) . ": ", 'VALUE' => $yes_no)), 'ALERTE_MSG' => array('CONFIGURATION' => array('LBL' => $l->g(1166) . ": ", 'VALUE' => $yes_no)), 'ACCOUNTINFO' => array('CONFIGURATION' => array('LBL' => $l->g(1167) . ": ", 'VALUE' => $yes_no)), 'CHANGE_ACCOUNTINFO' => array('CONFIGURATION' => array('LBL' => $l->g(1168) . ": ", 'VALUE' => $yes_no)), 'CHANGE_USER_GROUP' => array('CONFIGURATION' => array('LBL' => $l->g(1169) . ": ", 'VALUE' => $yes_no)), 'MANAGE_PROFIL' => array('CONFIGURATION' => array('LBL' => $l->g(1170) . ": ", 'VALUE' => $yes_no)), 'MANAGE_USER_GROUP' => array('CONFIGURATION' => array('LBL' => $l->g(1171) . ": ", 'VALUE' => $yes_no)), 'MANAGE_SMTP_COMMUNITIES' => array('CONFIGURATION' => array('LBL' => $l->g(1205) . ": ", 'VALUE' => $yes_no)), 'DELETE_COMPUTERS' => array('CONFIGURATION' => array('LBL' => $l->g(1272) . ": ", 'VALUE' => $yes_no))); $lbl_cat = array('INFO' => $l->g(1173), 'PAGE_PROFIL' => $l->g(1174), 'RESTRICTION' => $l->g(1175), 'ADMIN_BLACKLIST' => $l->g(1176), 'CONFIGURATION' => $l->g(1177)); if ($protectedPost['Valid_modif_profil']) { //read profil file $forprofil = read_profil_file($protectedPost['PROFILS']); //read all profil value $forall = read_config_file(); //build new tab with new values foreach ($info_field as $if_name => $if_value) { foreach ($if_value as $if_cat => $if_val) { if (isset($protectedPost[$if_name]) and $protectedPost['cat'] == $if_cat) { $new_value[$if_cat][$if_name] = $protectedPost[$if_name]; } else { $new_value[$if_cat][$if_name] = $forprofil[$if_cat][$if_name]; } } } foreach ($forall['URL'] as $name => $value) { if (isset($protectedPost[$name]) and $protectedPost['cat'] == "PAGE_PROFIL") { $new_value["PAGE_PROFIL"][$name] = ''; } } if (!isset($new_value['PAGE_PROFIL'])) { $new_value['PAGE_PROFIL'] = $forprofil['PAGE_PROFIL']; } update_config_file($protectedPost['PROFILS'], $new_value); msg_success($l->g(1274)); } $array_profil = get_profile_labels(); echo $l->g(1196) . ": " . show_modif($array_profil, "PROFILS", 2, $form); echo "<a href=\"index.php?" . PAG_INDEX . "=" . $pages_refs['ms_new_profil'] . "&head=1&form=" . $form . "\"><img src=image/plus.png></a>"; if (isset($protectedPost['PROFILS']) and $protectedPost['PROFILS'] != '') { $forall = read_config_file(); $forprofil = read_profil_file($protectedPost['PROFILS'], 'WRITE'); if (is_array($forprofil) and is_array($forall)) { foreach ($forprofil as $key => $value) { if (isset($lbl_cat[$key])) { $data_on[$key] = $lbl_cat[$key]; } } onglet($data_on, $form, "cat", 10); if (isset($forprofil[$protectedPost['cat']]) and $protectedPost['cat'] != 'PAGE_PROFIL') { $name_field = array(); $type_field = array(); $tab_name = array(); $value_field = array(); foreach ($info_field as $if_name => $if_value) { foreach ($if_value as $if_cat => $if_val) { if ($protectedPost['cat'] == $if_cat) { if (isset($forprofil[$if_cat][$if_name])) { $protectedPost[$if_name] = $forprofil[$if_cat][$if_name]; } array_push($name_field, $if_name); array_push($tab_name, $if_val['LBL']); if (is_array($if_val['VALUE'])) { array_push($type_field, 2); if (!isset($protectedPost[$if_name])) { array_push($if_val['VALUE'], ''); } array_push($value_field, $if_val['VALUE']); } else { array_push($type_field, 0); array_push($value_field, replace_language($forprofil[$if_cat][$if_name])); } } } } $tab_typ_champ = show_field($name_field, $type_field, $value_field); tab_modif_values($tab_name, $tab_typ_champ, $tab_hidden, array('button_name' => 'modif_profil')); } elseif ($protectedPost['cat'] == 'PAGE_PROFIL') { $champs = "<table align=center><tr><td align=center>"; $i = 0; ksort($forall['URL']); foreach ($forall['URL'] as $key => $value) { $champs .= "<input type='checkbox' name='" . $key . "' id='" . $key . "' "; if (isset($forprofil[$protectedPost['cat']][$key])) { $champs .= " checked "; } $champs .= " ></td><td>" . $key . "</td><td align=center>"; $i++; if ($i == 4) { $champs .= "</td></tr><tr><td align=center>"; $i = 0; } } $champs .= "</td></tr></table>"; tab_modif_values($champs, array(), array(), array('button_name' => 'modif_profil')); } } } }
function exec_controle_forum_args2($id_rubrique, $type, $debut, $pas, $enplus, $recherche, $from, $where, $debut_id_forum) { // Si un id_controle_forum est demande, on adapte le debut if ($debut_id_forum AND (NULL !== ($d = sql_getfetsel('date_heure', 'spip_forum', "id_forum=$debut_id_forum")))) { $debut = sql_countsel($from, $where . (" AND F.date_heure > '$d'")); } if ($recherche) $args = 'recherche='.rawurlencode($recherche).'&'; else $args = ''; $args .= (!$id_rubrique ? "" : "id_rubrique=$id_rubrique&") . 'type='; $query = array('SELECT' => "F.id_forum, F.id_parent, F.id_rubrique, F.id_article, F.id_breve, F.date_heure, F.titre, F.texte, F.auteur, F.email_auteur, F.nom_site, F.url_site, F.statut, F.ip, F.id_auteur", 'FROM' => $from, 'WHERE' => $where, 'GROUP BY' => "", 'ORDER BY' => "F.date_heure DESC"); $nav = affiche_navigation_forum($query, 'controle_forum', $args . $type, $debut, $pas, $enplus); $select = sql_select($query['SELECT'], $query['FROM'], $query['WHERE'], $query['GROUP BY'], $query['ORDER BY'], $query['LIMIT']); $res = ''; while ($row = sql_fetch($select)) $res .= controle_forum_boucle($row, "$args$type&debut=$debut"); $res = "<br />$nav<br />$res<br />$nav"; if (_AJAX) { ajax_retour($res); } else { pipeline('exec_init',array('args'=>array('exec'=>'controle_forum', 'type'=>$type),'data'=>'')); $commencer_page = charger_fonction('commencer_page', 'inc'); echo $commencer_page(_T('titre_page_forum_suivi'), "forum", "forum-controle"); echo "<br /><br /><br />"; echo gros_titre(_T('titre_forum_suivi'),'',false); echo debut_onglet(); echo onglet(_T('onglet_messages_publics'), generer_url_ecrire('controle_forum', $args . "public"), "public", $type=='public', "forum-public-24.gif"); echo onglet(_T('onglet_messages_internes'), generer_url_ecrire('controle_forum', $args . "interne"), "interne", $type=='interne', "forum-interne-24.gif"); list($from,$where) = critere_statut_controle_forum('vide', $id_rubrique); $n = sql_fetsel('1', $from, $where); if ($n) echo onglet(_T('onglet_messages_vide'), generer_url_ecrire('controle_forum', $args . "vide"), "vide", $type=='vide'); list($from,$where) = critere_statut_controle_forum('prop', $id_rubrique); $f = sql_fetsel('1', $from, $where); if ($f) echo onglet(_T('texte_statut_attente_validation'), generer_url_ecrire('controle_forum', $args . "prop"), "prop", $type=='prop'); echo fin_onglet(); echo debut_gauche('', true); echo debut_boite_info(true); echo "<span class='verdana1 spip_small'>", _T('info_gauche_suivi_forum_2'), aide("suiviforum"), "</span>"; // Afficher le lien RSS echo bouton_spip_rss("forums_$type"); echo fin_boite_info(true); echo pipeline('affiche_gauche',array('args'=>array('exec'=>'controle_forum', 'type'=>$type),'data'=>'')); echo creer_colonne_droite('', true); echo pipeline('affiche_droite',array('args'=>array('exec'=>'controle_forum', 'type'=>$type),'data'=>'')); echo debut_droite('', true); echo pipeline('affiche_milieu',array('args'=>array('exec'=>'controle_forum', 'type'=>$type),'data'=>'')); echo formulaire_recherche("controle_forum","<input type='hidden' name='type' value='$type' />"); echo "<div class='nettoyeur'></div>"; echo "<div id='controle_forum' class='serif2'>", $res, "</div>"; echo fin_gauche(), fin_page(); } }
if (isset($protectedGet['origine']) and is_numeric($protectedGet['idchecked'])) { //looking for value of systemid $sql_value_idhardware = "select NAME,IVALUE,TVALUE from devices where name != 'DOWNLOAD' and hardware_id=%s"; $arg_value_idhardware = $protectedGet['idchecked']; $result_value = mysql2_query_secure($sql_value_idhardware, $_SESSION['OCS']["readServer"], $arg_value_idhardware); while ($value = mysqli_fetch_array($result_value)) { $optvalue[$value["NAME"]] = $value["IVALUE"]; $optvalueTvalue[$value["NAME"]] = $value["TVALUE"]; } $champ_ignored = 0; } elseif ($list_id) { $tab_hadware_id = explode(",", $list_id); $champ_ignored = 1; } if ($list_id) { onglet($def_onglets, $form_name, 'onglet', 7); echo '<div class="mlt_bordure" >'; if ($protectedPost['onglet'] == 'INV') { include 'ms_custom_frequency.php'; } if ($protectedPost['onglet'] == 'SERV') { include 'ms_custom_prolog.php'; } if ($protectedPost['onglet'] == 'TELE') { include 'ms_custom_download.php'; } if ($protectedPost['onglet'] == 'RSX') { include 'ms_custom_ipdiscover.php'; } echo "</div>"; }
* Administre your DATA for download workflow * */ require_once 'require/function_admin_management.php'; if (!isset($protectedPost['onglet']) or $protectedPost['onglet'] == '') { $protectedPost['onglet'] = 1; } $form_name = 'admin_telediff_wk'; $table_name = $form_name; $data_on[1] = $l->g(1059); $data_on[2] = $l->g(1060); $yes_no = array($l->g(454), $l->g(455)); $multi_choice = array('TEXT', 'TEXTAREA', 'SELECT', $l->g(802), 'PASSWORD', 'CHECKBOX', 'LIST', 'HIDDEN', 'BLOB (FILE)', 'LIST LINK', 'TAB'); echo "<br>"; echo open_form($form_name); onglet($data_on, $form_name, "onglet", 2); echo '<div class="mlt_bordure" >'; if ($protectedGet['admin'] == "tab") { $table = "downloadwk_tab_values"; $array_fields = array('FIELD' => 'FIELD', $l->g(224) => 'VALUE', $l->g(80) => 'LBL'); $array_values = array($protectedGet["value"], $protectedPost["newfield"], $protectedPost["newlbl"]); $field_search = "field"; } elseif ($protectedGet['admin'] == "fields") { $table = "downloadwk_fields"; $sql_status = "SELECT id,lbl FROM downloadwk_statut_request"; $res_status = mysql2_query_secure($sql_status, $_SESSION['OCS']["readServer"]); $status['0'] = $l->g(454); while ($val_status = mysql_fetch_array($res_status)) { $status[$val_status['id']] = $val_status['lbl']; } $array_fields = array($l->g(1061) => 'TAB', $l->g(1062) => 'FIELD', $l->g(66) => 'TYPE', $l->g(1063) => 'LBL', $l->g(1064) => 'MUST_COMPLETED', $l->g(1065) => 'RESTRICTED', $l->g(1066) => 'LINK_STATUS');
if (isset($protectedPost['NO_VISIBLE']) and $protectedPost['NO_VISIBLE'] != '' and isset($_SESSION['OCS']['ADMIN_CONSOLE'])) { delete($protectedPost['NO_VISIBLE']); } if (isset($protectedPost['UPDATE_VALUE']) and $protectedPost['UPDATE_VALUE'] != '' and isset($_SESSION['OCS']['ADMIN_CONSOLE'])) { $arg = look_config_default_values($protectedPost['UPDATE_VALUE']); insert_update($protectedPost['UPDATE_VALUE'], $protectedPost[$protectedPost['UPDATE_VALUE']], $arg['ivalue'][$protectedPost['UPDATE_VALUE']], 'IVALUE'); } require_once 'require/function_console.php'; $data_on = define_tab(); $data_tab = show_active_tab($data_on); echo open_form($form_name); if (isset($protectedPost["onglet"]) and !isset($data_tab['DATA'][$protectedPost["onglet"]])) { $protectedPost["onglet"] = $data_tab['DEFAULT']; } if ($data_tab['DATA'] != array()) { onglet($data_tab['DATA'], $form_name, "onglet", 8); echo '<div class="mlt_bordure" >'; if ($_SESSION['OCS']['CONFIGURATION']['CONSOLE'] == 'YES') { echo "<table align='right' border='0'><tr><td colspan=10 align='right'><a href=# OnClick='pag(\"ADMIN\",\"ADMIN\",\"" . $form_name . "\");'>"; if (isset($_SESSION['OCS']['ADMIN_CONSOLE']) and $_SESSION['OCS']['ADMIN_CONSOLE'] == 'ADMIN') { echo "<img src='image/success.png'>"; } else { echo "<img src='image/modif_tab.png'>"; } echo "</a></td></tr></table>"; } if ($data_on['DATA'][$protectedPost['onglet']]) { $fields = list_field($protectedPost['onglet']); show_console_field($fields, $form_name); } else { $array_group = "";