Changeset 2977

Show
Ignore:
Timestamp:
07/25/08 16:47:45 (1 month ago)
Author:
gcroes
Message:

Avancement de l'interface

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/project/modules/devel/cms3/heading/actiongroups/admin.actiongroup.php

    r2957 r2977  
    99        $ppo->TITLE_PAGE = 'Administration des contenus du site'; 
    1010        $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'); 
    1213    } 
    1314     
     
    9293                    ))); 
    9394    } 
     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    } 
    94102} 
  • trunk/project/modules/devel/cms3/heading/classes/headingelementinformationservices.class.php

    r2975 r2977  
    469469        return $results[0]->parent_heading_public_id_hei; 
    470470    } 
     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    } 
    471498} 
  • trunk/project/modules/devel/cms3/heading/classes/headingelementtype.class.php

    r2956 r2977  
    3636            throw new CopixException ('Element de type '.$pId.' non trouvé'); 
    3737        } 
    38         return $arData[$id]['caption']; 
     38        return $arData[$pId]['caption']; 
    3939    } 
    4040     
  • trunk/project/modules/devel/cms3/heading/module.xml

    r2957 r2977  
    1111    <registry> 
    1212     <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" /> 
    1414     </entry> 
    1515    </registry> 
  • trunk/project/modules/devel/cms3/heading/templates/headingelements.admin.php

    r2970 r2977  
    33</div> 
    44 
    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">&nbsp;</th> 
     14  <th>Libellé</th> 
     15 </tr> 
     16</thead> 
     17<tbody> 
     18<?php 
     19foreach ($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  
     39foreach ($ppo->arHeadingElementTypes as $id=>$headingElementType){ 
     40?> 
    741 <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;" /> 
    1050  </li>   
    1151 </ul> 
    12 {/foreach} 
     52<?php 
     53}  
     54?> 
    1355</div> 
    1456 
    15  
    16 {copixhtmlheader kind="jsdomreadycode"} 
    17 {literal} 
    18  
     57<?php  
     58$javaScript = '  
    1959var 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); 
    2262       el.addEvents({ 
    2363        mouseenter: function(){ 
     
    3171     
    3272    function startFXArray (idElement){ 
    33         resetFxArray (idElement, {'duration':300, 'wait': false}); 
     73        resetFxArray (idElement, {\'duration\':300, \'wait\': false}); 
    3474        FXArray[idElement][0].start (1); 
    3575        FXArray[idElement][1].start (64); 
    36         FXArray[idElement][2].start (64);       
     76        FXArray[idElement][2].start (64); 
     77        FXArray[idElement][3].start (0);        
    3778    } 
    3879     
    3980    function stopFxArray (idElement){ 
    40         resetFxArray (idElement, {'duration':1000, 'wait': false}); 
     81        resetFxArray (idElement, {\'duration\':1000, \'wait\': false}); 
    4182        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); 
    4486    } 
    4587     
     
    5193          FXArray[idElement][1].stop (); 
    5294          FXArray[idElement][2].stop (); 
    53        } 
     95          FXArray[idElement][3].stop (); 
     96        } 
    5497 
    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); 
    58102    } 
    59  
    60 {/literal} 
    61 {/copixhtmlheader} 
     103'; 
     104CopixHTMLHeader::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>