Changeset 10255 in spip-zone
- Timestamp:
- Mar 9, 2007, 12:09:57 AM (14 years ago)
- Location:
- _plugins_/_dev_/spip_outliner
- Files:
-
- 18 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/_dev_/spip_outliner/action/outline_add_col.php
r10213 r10255 7 7 function action_outline_add_col_dist() 8 8 { 9 $securiser_action = charger_fonction('securiser_action', 'inc'); 10 $arg = $securiser_action(); 9 //$securiser_action = charger_fonction('securiser_action', 'inc'); 10 //$arg = $securiser_action(); 11 $arg = _request('arg'); 11 12 12 13 $arg = explode(':',$arg); 13 14 $id_form = $arg[0]; 14 $champ = $arg[ 1];15 $champ_prev = $arg[ 2];15 $champ = $arg[2]; 16 $champ_prev = $arg[1]; 16 17 $rang = 0; 17 18 -
_plugins_/_dev_/spip_outliner/action/outline_add_row.php
r10213 r10255 7 7 function action_outline_add_row_dist() 8 8 { 9 $securiser_action = charger_fonction('securiser_action', 'inc'); 10 $arg = $securiser_action(); 9 //$securiser_action = charger_fonction('securiser_action', 'inc'); 10 //$arg = $securiser_action(); 11 $arg = _request('arg'); 11 12 12 13 $arg = explode(':',$arg); 13 14 $id_form = $arg[0]; 14 $id_donnee = $arg[ 1];15 $id_donnee_prev = $arg[ 2];15 $id_donnee = $arg[2]; 16 $id_donnee_prev = $arg[1]; 16 17 $rang = 0; 17 18 $niveau = "select_1_1"; -
_plugins_/_dev_/spip_outliner/action/outline_supp_col.php
r10216 r10255 7 7 function action_outline_supp_col_dist() 8 8 { 9 $securiser_action = charger_fonction('securiser_action', 'inc'); 10 $arg = $securiser_action(); 9 //$securiser_action = charger_fonction('securiser_action', 'inc'); 10 //$arg = $securiser_action(); 11 $arg = _request('arg'); 11 12 12 13 $arg = explode(':',$arg); -
_plugins_/_dev_/spip_outliner/action/outline_supp_row.php
r10213 r10255 7 7 function action_outline_supp_row_dist() 8 8 { 9 $securiser_action = charger_fonction('securiser_action', 'inc'); 10 $arg = $securiser_action(); 9 //$securiser_action = charger_fonction('securiser_action', 'inc'); 10 //$arg = $securiser_action(); 11 $arg = _request('arg'); 11 12 12 13 $arg = explode(':',$arg); -
_plugins_/_dev_/spip_outliner/javascript/outliner.js
r10237 r10255 1 function init_events(){ 2 $('td').click(function(){ $(this).selectRow(); }); 3 $('th').click(function(){ $(this).selectCol(); }); 4 $('img.noeud').click(function(){ $(this).toggleLine(); }); 5 } 6 // selectionne une ligne 7 var row_selected=undefined; 8 var col_selected=undefined; 9 function unselect_all(){ 10 if (row_selected!=undefined) 11 row_selected.removeClass('row_sel'); 12 row_selected = undefined; 13 if (col_selected!=undefined) 14 $('td.col_sel,th.col_sel').removeClass('col_sel'); 15 col_selected = undefined; 16 } 17 jQuery.fn.selectRow = function() { 18 unselect_all(); 19 row_selected = this.parents('tr.row'); 20 return this 21 .parents('tr.row') 22 .addClass('row_sel'); 23 } 24 jQuery.fn.selectCol = function() { 25 unselect_all(); 26 col_selected = this.attr('class'); 27 $('td.'+col_selected).addClass('col_sel'); 28 $('th.'+col_selected).addClass('col_sel'); 29 return this; 30 } 31 32 // replier/reduire par niveau 33 function getLevel(c){ 34 var n = c.match(/niveau-(\d+)/); 35 if (n) { 36 n = n[1] ? parseInt(n[1]) : 1; 37 } 38 else n=1; 39 return n; 40 } 41 jQuery.fn.toggleLine = function() { 42 niveau = getLevel(this.parent().attr('class')); 43 expand=false; 44 if (this.attr('src')==img_noeud_plus) { 45 expand=true; 46 } 47 else { 48 this.attr('src',img_noeud_plus); 49 } 50 cur = l = this.parents('tr.row'); 51 next = l.next('tr.row'); 52 while (next.size() && (n=getLevel(next.find('div.niveau').attr('class')) >niveau)){ 53 if (expand){ 54 cur.find('img.noeud').attr('src',img_noeud_moins); 55 next.show(); 56 } 57 else { 58 next.hide(); 59 } 60 cur = next; 61 next = next.next('tr.row'); 62 } 63 if (expand){ 64 cur.find('img.noeud').attr('src',img_noeud_plus); 65 } 66 return this; 67 } 1 68 function filtre_niveau(niveau){ 2 69 for (i=1;i<10;i++){ 3 if (i<=niveau) 4 $('.niveau-'+i).parents('tr.row').show(); 70 if (i<=niveau){ 71 l=$('.niveau-'+i); 72 l.parents('tr.row').show(); 73 if (i<niveau) l.find('img.noeud').attr('src',img_noeud_moins); 74 else l.find('img.noeud').attr('src',img_noeud_plus); 75 } 5 76 else 6 77 $('.niveau-'+i).parents('tr.row').hide(); 7 78 } 8 79 } 80 81 // augmenter/reduire le niveau 82 jQuery.fn.changeLevel = function(increment) { 83 niveau = getLevel(this.find('div.niveau').attr('class')); 84 if (niveau+increment<1) return this; 85 ids = this.attr('id')+':'+niveau; 86 this.find('div.niveau').attr('class','niveau niveau-'+(niveau+increment)); 87 cur = this.next('tr.row'); 88 while (cur.size() && ( (n=getLevel(cur.find('div.niveau').attr('class'))) >niveau)){ 89 ids = ids+','+cur.attr('id')+':'+n; 90 cur.find('div.niveau').attr('class','niveau niveau-'+(n+increment)); 91 cur = cur.next('tr.row'); 92 } 93 //alert(ids); 94 return this; 95 } 96 97 // fonctions de la toolbar 98 function CollapseAll(){ 99 filtre_niveau(1); 100 } 101 function ExpandAll(){ 102 filtre_niveau(10); 103 } 104 function MoveLeft(){ 105 $('tr.row_sel').changeLevel(-1); 106 } 107 function MoveRight(){ 108 $('tr.row_sel').changeLevel(1); 109 } 110 function actionItem(lien){ 111 href = $(lien).attr('href'); 112 sel = $('tr.row_sel'); 113 if (sel.size()==0) return false; 114 sel = sel.eq(0); 115 href = href+':'+sel.attr('id'); 116 sel = sel.next('tr.row'); 117 if (sel.size()) 118 href = href+':'+sel.attr('id'); 119 else 120 href = href+':0'; 121 $(lien).attr('href',href); 122 } 123 function AddItem(lien){ 124 return actionItem(lien) 125 } 126 function RemoveItem(lien){ 127 return actionItem(lien) 128 } 129 130 function actionColumn(lien){ 131 href = $(lien).attr('href'); 132 sel = $('th.col_sel'); 133 if (sel.size()==0) return false; 134 sel = sel.eq(0); 135 sel.removeClass('col_sel'); 136 href = href+':'+sel.attr('class'); 137 sel.addClass('col.sel'); 138 sel = sel.next('th'); 139 if (sel.size()) 140 href = href+':'+sel.attr('class'); 141 else 142 href = href+':0'; 143 $(lien).attr('href',href); 144 } 145 function AddColumn(lien){ 146 return actionColumn(lien); 147 } 148 function RemoveColumn(lien){ 149 return actionColumn(lien); 150 } 151 152 $(document).ready(function(){ 153 init_events(); 154 }); -
_plugins_/_dev_/spip_outliner/outline.html
r10237 r10255 8 8 <link rel="stylesheet" href="[(#CHEMIN{outliner.css})]" type="text/css" media="all" /> 9 9 <script type='text/javascript' src='#CHEMIN{javascript/outliner.js}'></script> 10 <script type='text/javascript'><!-- 11 var img_noeud_plus='#EVAL{_DIR_IMG_PACK}noeud_plus.gif'; 12 var img_noeud_moins='#EVAL{_DIR_IMG_PACK}noeud_moins.gif'; 13 //--> 14 </script> 10 15 </head> 11 16 12 17 <body class="outliner"> 18 [(#INCLUDE{fond=outline_toolbar}{id_table=#ENV{id_table}})] 13 19 <div id="outline"> 14 15 20 <B_titreh> 16 21 <table class="outline donnees" id='donnees-#ENV{id_table}'> 17 22 <BOUCLE_caption(FORMS){id_form=#ENV{id_table}}> 18 <caption> 19 <select name='niveau' id='selecteur_niveau' onchange='filtre_niveau(this.value)'> 20 <option value='10' selected='selected'>Filtrer l'affichage par niveau</option> 21 <option value='1'>Niveau 1</option> 22 <option value='2'>Niveau 2</option> 23 <option value='3'>Niveau 3</option> 24 <option value='4'>Niveau 4</option> 25 <option value='5'>Niveau 5</option> 26 <option value='6'>Niveau 6</option> 27 <option value='7'>Niveau 7</option> 28 <option value='8'>Niveau 8</option> 29 <option value='9'>Niveau 9</option> 30 </select> 31 #TITRE</caption></BOUCLE_caption> 23 <caption>#TITRE</caption></BOUCLE_caption> 32 24 <thead><tr class='row_first'> 33 < th></th>25 <!--<th></th>--> 34 26 <th>id</th> 35 <th >27 <th class='ligne_1'> 36 28 <BOUCLE_titreh(FORMS_CHAMPS){id_form=#ENV{id_table}}{champ=ligne_1}> 37 29 <span class='#EDIT{titre}'>#TITRE</span> … … 39 31 </th> 40 32 <BOUCLE_head(FORMS_CHAMPS){id_form=#ENV{id_table}}{champ !IN (select_1,ligne_1)}{type !IN (separateur,textestatique)}{par rang}> 41 <th ><span class='#EDIT{titre}'>#TITRE</span></th>33 <th class='#CHAMP'><span class='#EDIT{titre}'>#TITRE</span></th> 42 34 </BOUCLE_head> 43 < th></th>35 <!--<th></th>--> 44 36 </tr></thead> 45 <tbody> 37 <tbody><!-- 46 38 <tr class='row_first'> 47 39 <td></td> … … 58 50 <img src='#CHEMIN{img_pack/outline_insert_col-24.png}' width='24' height='24' alt='<:outliner:insertion_colonne:>' /> 59 51 </a></td>#SET{champprev,#CHAMP} 60 </tr> 52 </tr>--> 61 53 #SET{prev,0} 62 54 <BOUCLE_donnees(FORMS_DONNEES){id_form=#ENV{id_table}}{id_mot?}{par rang}{statut!=poubelle}> … … 64 56 #SET{lien_supprow,#URL_ACTION_AUTEUR{outline_supp_row,#ID_FORM:#ID_DONNEE,(#SELF|urlencode)}} 65 57 #SET{prev,#ID_DONNEE} 66 <tr class='row [(#COMPTEUR_BOUCLE|alterner{row_even,row_odd})]'>67 < td><a href='#GET{lien_addrow}' title='<:outliner:insertion_ligne:>'><img src='#CHEMIN{img_pack/outline_insert_ligne-24.png}' width='24' height='24' alt='<:outliner:insertion_ligne:>' /></a></td>58 <tr id='#ID_DONNEE' class='row [(#COMPTEUR_BOUCLE|alterner{row_even,row_odd})]'> 59 <!--<td><a href='#GET{lien_addrow}' title='<:outliner:insertion_ligne:>'><img src='#CHEMIN{img_pack/outline_insert_ligne-24.png}' width='24' height='24' alt='<:outliner:insertion_ligne:>' /></a></td>--> 68 60 <td><a href='[(#SELF|parametre_url{id_donnee,#ID_DONNEE}|ancre_url{donnee-#ID_DONNEE})]'>#ID_DONNEE</a></td> 69 <td >61 <td class='ligne_1'> 70 62 <table><tr > 71 63 <BOUCLE_niveau(FORMS_CHAMPS){id_form}{champ=select_1}> 72 <td class='niveau'><span class='#_donnees:EDIT{#CHAMP}'><div class='niveau niveau-#LESVALEURS'>#PUCE</div></span></td> 64 <td class='niveau'>[(#REM)<span class='#_donnees:EDIT{#CHAMP}'>] 65 <div class='niveau niveau-#LESVALEURS'><img src='#EVAL{_DIR_IMG_PACK}noeud_moins.gif' width='16' height='16' class='noeud'/></div> 66 [(#REM)</span>]</td> 73 67 </BOUCLE_niveau> 74 68 <BOUCLE_titre(FORMS_CHAMPS){id_form}{champ=ligne_1}> … … 78 72 </td> 79 73 <BOUCLE_body(FORMS_CHAMPS){id_form}{type !IN (separateur,textestatique)}{par rang}{champ !IN (select_1,ligne_1)}> 80 <td ><span class='#_donnees:EDIT{#CHAMP}'>#LESVALEURS{'<br />'}</span></td>74 <td class='#CHAMP'><span class='#_donnees:EDIT{#CHAMP}'>#LESVALEURS{'<br />'}</span></td> 81 75 </BOUCLE_body> 82 < td><a href='#GET{lien_supprow}' title='<:outliner:suppression_ligne:>'><img src='#CHEMIN{img_pack/supprimer-24.png}' width='24' height='24' alt='<:outliner:suppression_ligne:>' /></a></td>76 <!--<td><a href='#GET{lien_supprow}' title='<:outliner:suppression_ligne:>'><img src='#CHEMIN{img_pack/supprimer-24.png}' width='24' height='24' alt='<:outliner:suppression_ligne:>' /></a></td>--> 83 77 </tr> 84 78 </BOUCLE_donnees> 85 #SET{lien_addrow,#URL_ACTION_AUTEUR{outline_add_row,#ENV{id_table}|concat{:0:#GET{prev}},(#SELF|urlencode)}}79 <!--#SET{lien_addrow,#URL_ACTION_AUTEUR{outline_add_row,#ENV{id_table}|concat{:0:#GET{prev}},(#SELF|urlencode)}} 86 80 <tr class='row_last'> 87 81 <td><a href='#GET{lien_addrow}' title='<:outliner:insertion_ligne:>'><img src='#CHEMIN{img_pack/outline_insert_ligne-24.png}' width='24' height='24' alt='<:outliner:insertion_ligne:>' /></a></td> 88 82 <td></td> 89 <td >83 <td class='ligne_1'> 90 84 </td> 91 85 #SET{champprev,ligne_1} 92 86 <BOUCLE_pied(FORMS_CHAMPS){id_form=#ENV{id_table}}{champ !IN (select_1,ligne_1)}{type !IN (separateur,textestatique)}{par rang}> 93 <td ><a href='#URL_ACTION_AUTEUR{outline_supp_col,#ENV{id_table}|concat{:#CHAMP,:#GET{champprev}},(#SELF|urlencode)}' title='<:outliner:suppression_colonne:>'>87 <td class='#CHAMP'><a href='#URL_ACTION_AUTEUR{outline_supp_col,#ENV{id_table}|concat{:#CHAMP,:#GET{champprev}},(#SELF|urlencode)}' title='<:outliner:suppression_colonne:>'> 94 88 <img src='#CHEMIN{img_pack/supprimer-24.png}' width='24' height='24' alt='<:outliner:suppression_colonne:>' /> 95 89 </a></td>#SET{champprev,#CHAMP} … … 98 92 <img src='#CHEMIN{img_pack/supprimer-24.png}' width='24' height='24' alt='<:outliner:suppression_colonne:>' /> 99 93 </a></td>#SET{champprev,#CHAMP} 100 </tr> 94 </tr>--> 101 95 102 96 </tbody> … … 105 99 #MODELE{donnee,id_donnee=#EVAL{$_GET['id_donnee']} } 106 100 101 #FORMULAIRE_ADMIN 107 102 </div><!-- fin page --> 108 103 </body> -
_plugins_/_dev_/spip_outliner/outliner.css
r10237 r10255 1 /* Tableaux*/1 /* La Page */ 2 2 #outline { 3 3 font-size:small; 4 4 width:100%; 5 5 margin-top:70px; 6 6 } 7 7 8 /* la Tool bar */ 9 #toolbar { 10 display:block; 11 position:fixed; 12 left:0px; 13 top:0px; 14 width:100%; 15 height:70px; 16 background:#ffffff; 17 border-bottom:3px solid #ccc; 18 } 19 #toolbar a { 20 display:block; 21 float:left; 22 } 23 #toolbar a img { 24 filter: alpha(opacity=70); 25 opacity: 0.7; 26 -moz-opacity: 0.7; 27 padding:3px; 28 background:none; 29 } 30 #toolbar a:hover img { 31 filter: alpha(opacity=100); 32 opacity: 1.0; 33 -moz-opacity: 1.0; 34 background:#ffffcc; 35 } 36 37 38 /* Les crayons */ 8 39 .crayon-icones span { 9 40 margin-left:-20px; … … 15 46 padding-bottom:20px; 16 47 } 48 49 /* Le selecteur de niveau */ 17 50 #selecteur_niveau{ 18 51 float:right; 19 52 } 53 54 /* L'outline */ 20 55 table.outline { 21 56 width:100%; … … 39 74 } 40 75 76 /* sous table dans la celule ligne_1 pour gerer le decalage lie au niveau */ 41 77 table.outline table { 42 78 width:100%; … … 60 96 div.niveau-9{padding-left:85px;} 61 97 62 63 /* Barre de raccourcis typographiques */ 64 table.spip_barre { width: 100%; } 65 66 table.spip_barre a img { 67 background: #FDA; 68 padding: 3px; 69 border: 1px outset #999; } 70 table.spip_barre a:hover img { 71 background: #FFF; 72 border: 1px solid #999; } 73 74 table.spip_barre input.barre { width: 100%; background: #EEE; } 98 /* selection ligne et colonne */ 99 table.outline tr.row_sel { background: #ffffcc; } 100 table.outline td.col_sel,table.outline th.col_sel { background: #ffcc99; }
Note: See TracChangeset
for help on using the changeset viewer.