Changeset 409
- Timestamp:
- 11/30/07 10:28:15 (1 year ago)
- Files:
-
- trunk/project/modules/public/stable/tutorials/tags_demo/actiongroups/default.actiongroup.php (modified) (4 diffs)
- trunk/project/modules/public/stable/tutorials/tags_demo/templates/checkbox.tpl (modified) (1 diff)
- trunk/project/modules/public/stable/tutorials/tags_demo/templates/multipleselect.tpl (modified) (1 diff)
- trunk/project/modules/public/stable/tutorials/tags_demo/templates/radiobutton.tpl (modified) (1 diff)
- trunk/project/modules/public/stable/tutorials/tags_demo/templates/select.tpl (modified) (1 diff)
- trunk/utils/copix/taglib/checkbox.templatetag.php (modified) (2 diffs)
- trunk/utils/copix/taglib/multipleselect.templatetag.php (modified) (2 diffs)
- trunk/utils/copix/taglib/radiobutton.templatetag.php (modified) (2 diffs)
- trunk/utils/copix/taglib/select.templatetag.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/project/modules/public/stable/tutorials/tags_demo/actiongroups/default.actiongroup.php
r1 r409 70 70 $arObjects[] = $obj; 71 71 72 return _arPpo (new CopixPPO (array ('TITLE_PAGE'=>'Utilisation de select', 'arObjects'=>$arObjects )), 'select.tpl');72 return _arPpo (new CopixPPO (array ('TITLE_PAGE'=>'Utilisation de select', 'arObjects'=>$arObjects, 'iteratorObjects'=>new ArrayIterator ($arObjects))), 'select.tpl'); 73 73 } 74 74 /** … … 88 88 $arObjects[] = $obj; 89 89 90 return _arPpo (new CopixPPO (array ('TITLE_PAGE'=>'Utilisation de multipleselect', 'arObjects'=>$arObjects )), 'multipleselect.tpl');90 return _arPpo (new CopixPPO (array ('TITLE_PAGE'=>'Utilisation de multipleselect', 'arObjects'=>$arObjects, 'iteratorObjects'=>new ArrayIterator ($arObjects))), 'multipleselect.tpl'); 91 91 } 92 92 … … 107 107 $arObjects[] = $obj; 108 108 109 return _arPpo (new CopixPPO (array ('TITLE_PAGE'=>'Utilisation de radio boutton', 'arObjects'=>$arObjects )), 'radiobutton.tpl');109 return _arPpo (new CopixPPO (array ('TITLE_PAGE'=>'Utilisation de radio boutton', 'arObjects'=>$arObjects, 'iteratorObjects'=>new ArrayIterator ($arObjects))), 'radiobutton.tpl'); 110 110 } 111 111 … … 126 126 $arObjects[] = $obj; 127 127 128 return _arPpo (new CopixPPO (array ('TITLE_PAGE'=>'Utilisation d\'un checkbox', 'arObjects'=>$arObjects )), 'checkbox.tpl');128 return _arPpo (new CopixPPO (array ('TITLE_PAGE'=>'Utilisation d\'un checkbox', 'arObjects'=>$arObjects, 'iteratorObjects'=>new ArrayIterator ($arObjects))), 'checkbox.tpl'); 129 129 } 130 130 trunk/project/modules/public/stable/tutorials/tags_demo/templates/checkbox.tpl
r1 r409 36 36 <p>{checkbox name=checkbox values=$ppo->arObjects objectMap="id;caption"}</p> 37 37 38 <h2>Iterateur d'objets avec spécification de clef / valeurs</h2> 39 {ldelim}checkbox name=checkbox values=$ppo->iteratorObjects objectMap="id;caption"{rdelim} 40 <p>{checkbox name=checkbox values=$ppo->iteratorObjects objectMap="id;caption"}</p> 41 38 42 <h2>Paramètre extra pour rajouter des informations à la balise</h2> 39 43 {ldelim}checkbox extra='style="background-color: #ccc;"' name=checkbox values="1;2;3;4;5"|toarray{rdelim} 40 44 <p>{checkbox extra='style="background-color: #ccc;"' name=checkbox values="1;2;3;4;5"|toarray}</p> 41 45 42 43 46 <p><a href="{copixurl dest="default"}">Retour à la page de liste</a></p> trunk/project/modules/public/stable/tutorials/tags_demo/templates/multipleselect.tpl
r1 r409 54 54 55 55 56 {ldelim}multipleselect name=multipleselect id=autrechose values=$ppo->arObjects objectMap="id;caption"{rdelim} 57 <p>{multipleselect name=multipleselect8 id=autrechose values=$ppo->arObjects objectMap="id;caption"}</p> 56 {ldelim}multipleselect name=multipleselect8 values=$ppo->arObjects objectMap="id;caption"{rdelim} 57 <p>{multipleselect name=multipleselect8 values=$ppo->arObjects objectMap="id;caption"}</p> 58 59 <h2>Iterateur d'objets avec spécification de clef / valeurs</h2> 60 {ldelim}multipleselect name=multipleselect8b values=$ppo->iteratorObjects objectMap="id;caption"{rdelim} 61 <p>{multipleselect name=multipleselect8b values=$ppo->iteratorObjects objectMap="id;caption"}</p> 58 62 59 63 <h2>Paramètre extra pour rajouter des informations à la balise</h2> trunk/project/modules/public/stable/tutorials/tags_demo/templates/radiobutton.tpl
r1 r409 40 40 <p>{radiobutton name=radio4 values=$ppo->arObjects objectMap="id;caption"}</p> 41 41 42 <h2>Iterateur d'objets avec spécification de clef / valeurs</h2> 43 {ldelim}radiobutton name=radio4 values=$ppo->iteratorObjects objectMap="id;caption"{rdelim} 44 <p>{radiobutton name=radio4 values=$ppo->iteratorObjects objectMap="id;caption"}</p> 45 42 46 <h2>Paramètre extra pour rajouter des informations à la balise</h2> 43 47 Les styles sur les radio button ne marche pas très bien :`(<br/> trunk/project/modules/public/stable/tutorials/tags_demo/templates/select.tpl
r1 r409 52 52 <p>{select name=select id=autrechose values=$ppo->arObjects objectMap="id;caption"}</p> 53 53 54 <h2>Iterateur d'objets avec spécification de clef / valeurs</h2> 55 {ldelim}select name=select id=autrechose values=$ppo->iteratorObjects objectMap="id;caption"{rdelim} 56 <p>{select name=select id=autrechose values=$ppo->iteratorObjects objectMap="id;caption"}</p> 57 54 58 <h2>Paramètre extra pour rajouter des informations à la balise</h2> 55 59 {ldelim}select extra='style="background-color: #ccc;"' name=select values="1;2;3;4;5"|toarray{rdelim} trunk/utils/copix/taglib/checkbox.templatetag.php
r1 r409 30 30 $values = array (); 31 31 } 32 if ((!is_array ($values)) || ! ($values instanceof Iterator)){ 33 $values = (array) $values; 34 } 32 35 if (empty ($selected)){ 33 36 $selected = null; … … 52 55 //each of the values. 53 56 if (empty ($objectMap)){ 54 foreach ( (array)$values as $key=>$caption) {57 foreach ($values as $key=>$caption) { 55 58 $selectedString = ((array_key_exists('selected', $pParams)) && (in_array($key,(is_array($selected) ? $selected : array($selected))))) ? ' checked="checked" ' : ''; 56 59 $classString = (!empty($class)) ? ' class="'.$class.'"' : ''; trunk/utils/copix/taglib/multipleselect.templatetag.php
r332 r409 57 57 $values = array (); 58 58 } 59 if ((!is_array ($values)) || ! ($values instanceof Iterator)){ 60 $values = (array) $values; 61 } 59 62 if (empty ($height)) { 60 63 $height = 'auto'; … … 80 83 $arValues = $values; 81 84 $compteur=0; 82 foreach ( (array)$values as $key=>$caption) {85 foreach ($values as $key=>$caption) { 83 86 $selectedString = ((isset($selected) && (in_array($key,(is_array($selected) ? $selected : array($selected)), true)))) ? ' checked="checked" ' : ''; 84 87 $currentId = uniqid ('ch'); trunk/utils/copix/taglib/radiobutton.templatetag.php
r1 r409 39 39 $values = array (); 40 40 } 41 if ((!is_array ($values)) || ! ($values instanceof Iterator)){ 42 $values = (array) $values; 43 } 41 44 if (empty ($selected)){ 42 45 $selected = null; … … 70 73 //each of the values. 71 74 if (empty ($objectMap)){ 72 foreach ( (array)$values as $key=>$caption) {75 foreach ($values as $key=>$caption) { 73 76 $selectedString = ((array_key_exists('selected', $pParams)) && ($key == $selected)) ? ' checked="checked" ' : ''; 74 77 $toReturn .= '<input type="radio" '.$class.' id="'.$id.'" name="'.$name.'" '.$extra.' value="'.$key.'"'.$selectedString.' />' . _copix_utf8_htmlentities ($caption).$separator; trunk/utils/copix/taglib/select.templatetag.php
r1 r409 62 62 $values = array (); 63 63 } 64 64 if ((!is_array ($values)) || ! ($values instanceof Iterator)){ 65 $values = (array) $values; 66 } 65 67 //proceed 66 68 $toReturn = '<select name="'.$name.'" id="'.$id.'" '.$extra.'>'; 67 69 if ((!isset ($emptyShow)) || $emptyShow == true){ 68 70 //the "empty" element. If no key is the selected value, then its the one. 69 $selectedString = (isset ($selected) && in_array ($selected, array_keys ( (array)$values))) ? '' : ' selected="selected" ';71 $selectedString = (isset ($selected) && in_array ($selected, array_keys ($values))) ? '' : ' selected="selected" '; 70 72 list ($keyEmpty, $valueEmpty) = each ($emptyValues); 71 73 $toReturn .= '<option value="'.$keyEmpty.'"'.$selectedString.'>'.$valueEmpty.'</option>'; … … 74 76 //each of the values. 75 77 if (empty ($objectMap)){ 76 foreach ( (array)$values as $key=>$caption) {78 foreach ($values as $key=>$caption) { 77 79 $selectedString = ((!empty($selected)) && ($key == $selected)) ? ' selected="selected" ' : ''; 78 80 $toReturn .= '<option value="'.$key.'"'.$selectedString.'>' . _copix_utf8_htmlentities ($caption) . '</option>';
