Changeset 2977
- Timestamp:
- 07/25/08 16:47:45 (1 month ago)
- Files:
-
- trunk/project/modules/devel/cms3/heading/actiongroups/admin.actiongroup.php (modified) (2 diffs)
- trunk/project/modules/devel/cms3/heading/classes/headingelementinformationservices.class.php (modified) (1 diff)
- trunk/project/modules/devel/cms3/heading/classes/headingelementtype.class.php (modified) (1 diff)
- trunk/project/modules/devel/cms3/heading/module.xml (modified) (1 diff)
- trunk/project/modules/devel/cms3/heading/templates/headingelementinformation.tpl (added)
- trunk/project/modules/devel/cms3/heading/templates/headingelements.admin.php (moved) (moved from trunk/project/modules/devel/cms3/heading/templates/headingelements.admin.tpl) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/project/modules/devel/cms3/heading/actiongroups/admin.actiongroup.php
r2957 r2977 9 9 $ppo->TITLE_PAGE = 'Administration des contenus du site'; 10 10 $ppo->arHeadingElementTypes = _class ('heading|headingelementtype')->getList (); 11 return _arPpo ($ppo, 'headingelements.admin.tpl'); 11 $ppo->arHeadingElementInformations = _class ('heading|headingelementinformationservices')->find (array ('parent_heading_public_id_hei'=>_request ('heading', 0))); 12 return _arPpo ($ppo, 'headingelements.admin.php'); 12 13 } 13 14 … … 92 93 ))); 93 94 } 95 96 public function processHeadingElementInformation (){ 97 $element = _class ('heading|headingelementinformationservices')->getById (_request ('id_helt'), 98 _request ('type_hei')); 99 return _arContent (CopixZone::process ('headingelementinformation', array ('record'=>$element)), 100 array ('content-type'=>CopixMIMETypes::getFromExtension ('.html'))); 101 } 94 102 } trunk/project/modules/devel/cms3/heading/classes/headingelementinformationservices.class.php
r2975 r2977 469 469 return $results[0]->parent_heading_public_id_hei; 470 470 } 471 472 /** 473 * Recherche des éléments en fonction de divers critères 474 * 475 * @param array $pParams critères de recherche 476 * @return array 477 */ 478 public function find ($pParams){ 479 $sp = _daoSp ()->addCondition ('parent_heading_public_id_hei', '=', $pParams['parent_heading_public_id_hei']); 480 return _dao ('headingelementinformation')->findBy ($sp); 481 } 482 483 /** 484 * Récupération d'un élément en fonction de son identifiant 485 * 486 * @param int $pIdHelt l'identifiant de l'élément 487 * @param string $pTypeHei le type de l'élément 488 * @return CopixDAORecord 489 */ 490 public function getById ($pIdHelt, $pTypeHei){ 491 $results = _dao ('headingelementinformation')->findBy (_daoSp ()->addCondition ('id_helt', '=', $pIdHelt) 492 ->addCondition ('type_hei', '=', $pTypeHei)); 493 if (count ($results) < 1){ 494 throw new HeadingElementInformationNotFoundException ($pIdHelt.'-'.$pTypeHei); 495 } 496 return $results[0]; 497 } 471 498 } trunk/project/modules/devel/cms3/heading/classes/headingelementtype.class.php
r2956 r2977 36 36 throw new CopixException ('Element de type '.$pId.' non trouvé'); 37 37 } 38 return $arData[$ id]['caption'];38 return $arData[$pId]['caption']; 39 39 } 40 40 trunk/project/modules/devel/cms3/heading/module.xml
r2957 r2977 11 11 <registry> 12 12 <entry id="HeadingElement"> 13 <type id="heading" caption="Rubrique" image="heading|img/headings.png" />13 <type id="heading" caption="Rubrique" image="heading|img/headings.png" icon="heading|img/headings.png" /> 14 14 </entry> 15 15 </registry> trunk/project/modules/devel/cms3/heading/templates/headingelements.admin.php
r2970 r2977 3 3 </div> 4 4 5 <div style="height: 65px; margin-left: 30%; margin-right: 30%"> 6 {foreach from=$ppo->arHeadingElementTypes key=id item=headingElementType} 5 <div id="HeadingElementInformationDiv" style="float: right;width: 20%; border:1px solid #000;"> 6 7 </div> 8 9 <!-- Contenus existants --> 10 <table class="CopixTable" style="width: 78%"> 11 <thead> 12 <tr> 13 <th width="10"> </th> 14 <th>Libellé</th> 15 </tr> 16 </thead> 17 <tbody> 18 <?php 19 foreach ($ppo->arHeadingElementInformations as $headingElementInformation) { 20 ?> 21 <tr> 22 <td><input type="checkbox" name="arSelectedHeadingElementInformations[]" value="<?php echo $headingElementInformation->id_helt.'|'.$headingElementInformation->type_hei; ?>" /></td> 23 <td><a href="#" onclick="return showHeadingElementInformationsIn ('<?php echo $headingElementInformation->id_helt?>', '<?php echo $headingElementInformation->type_hei ?>', 'HeadingElementInformationDiv');"><img src="<?php echo _resource ($ppo->arHeadingElementTypes[$headingElementInformation->type_hei]['image']); ?>" 24 title="<?php echo $headingElementInformation->type_hei; ?>" 25 alt="<?php echo $headingElementInformation->type_hei; ?>" 26 height="24" width="24" /> 27 </a> 28 <?php echo $headingElementInformation->caption_hei; ?></td> 29 </tr> 30 <? 31 }//foreach 32 ?> 33 </tbody> 34 </table> 35 36 <!-- Barre d'outils pour les nouveaux éléments --> 37 <div style="height: 65px; margin-left: auto; margin-right: auto; width: <?php echo count ($ppo->arHeadingElementTypes)*64;?>px;"> 38 <?php 39 foreach ($ppo->arHeadingElementTypes as $id=>$headingElementType){ 40 ?> 7 41 <ul style="float: left;margin: 0px;padding:0px"> 8 <li style="list-style-type: none;display: block;margin: 0px;padding:0px;"> 9 <img id="img_{$id}" width="40" height="40" class="headingElementTypeImage" src="{copixresource path=$headingElementType.image}" alt="{$headingElementType.caption}" /> 42 <li style="list-style-type: none;display: block;margin: 0px;padding:0px;height: 70px;"> 43 <img id="img_<?php echo $id; ?>" 44 width="50" height="50" 45 class="headingElementTypeImage" 46 src="<?php echo _resource ($headingElementType['image']); ?>" 47 alt="<?php echo $headingElementType['caption']; ?>" 48 title="<?php echo $headingElementType['caption']; ?>" 49 style="padding-top: 20px;" /> 10 50 </li> 11 51 </ul> 12 {/foreach} 52 <?php 53 } 54 ?> 13 55 </div> 14 56 15 16 {copixhtmlheader kind="jsdomreadycode"} 17 {literal} 18 57 <?php 58 $javaScript = ' 19 59 var FXArray = new Array (); 20 $$( '.headingElementTypeImage').each (function (el){21 el.setStyle ( 'opacity', 0.5);60 $$(\'.headingElementTypeImage\').each (function (el){ 61 el.setStyle (\'opacity\', 0.5); 22 62 el.addEvents({ 23 63 mouseenter: function(){ … … 31 71 32 72 function startFXArray (idElement){ 33 resetFxArray (idElement, { 'duration':300, 'wait': false});73 resetFxArray (idElement, {\'duration\':300, \'wait\': false}); 34 74 FXArray[idElement][0].start (1); 35 75 FXArray[idElement][1].start (64); 36 FXArray[idElement][2].start (64); 76 FXArray[idElement][2].start (64); 77 FXArray[idElement][3].start (0); 37 78 } 38 79 39 80 function stopFxArray (idElement){ 40 resetFxArray (idElement, { 'duration':1000, 'wait': false});81 resetFxArray (idElement, {\'duration\':1000, \'wait\': false}); 41 82 FXArray[idElement][0].start (0.5); 42 FXArray[idElement][1].start (40); 43 FXArray[idElement][2].start (40); 83 FXArray[idElement][1].start (50); 84 FXArray[idElement][2].start (50); 85 FXArray[idElement][3].start (20); 44 86 } 45 87 … … 51 93 FXArray[idElement][1].stop (); 52 94 FXArray[idElement][2].stop (); 53 } 95 FXArray[idElement][3].stop (); 96 } 54 97 55 FXArray[idElement][0] = new Fx.Style(document.getElementById (idElement),'opacity', params); 56 FXArray[idElement][1] = new Fx.Style(document.getElementById (idElement),'width', params); 57 FXArray[idElement][2] = new Fx.Style(document.getElementById (idElement),'height', params); 98 FXArray[idElement][0] = new Fx.Style(document.getElementById (idElement),\'opacity\', params); 99 FXArray[idElement][1] = new Fx.Style(document.getElementById (idElement),\'width\', params); 100 FXArray[idElement][2] = new Fx.Style(document.getElementById (idElement),\'height\', params); 101 FXArray[idElement][3] = new Fx.Style(document.getElementById (idElement),\'padding-top\', params); 58 102 } 59 60 {/literal} 61 {/copixhtmlheader} 103 '; 104 CopixHTMLHeader::addJSDOMReadyCode ($javaScript); 105 ?> 106 107 <script> 108 function showHeadingElementInformationsIn (pIdElement, pTypeElement, pDivId){ 109 var AjaxRequest = new Ajax(Copix.getActionURL('heading|admin|headingelementinformation', {'id_helt':pIdElement, 'type_hei':pTypeElement}),{ 110 execScripts: true, 111 update: pDivId 112 }).request(); 113 return false; 114 } 115 </script>
