To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Show
Ignore:
Timestamp:
07/27/10 13:49:40 (22 months ago)
Author:
johnnyoffline
Message:

cleaned _area.php and _globalTools.php - they both use the new .a-ui namespace. the markup is lighter and more organized

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/branches/features/css/modules/a/templates/_area.php

    r1719 r1859  
    11<?php use_helper('a', 'jQuery', 'I18N') ?> 
    22 
    3 <?php // We don't replace the area controls on an AJAX refresh, just the contents ?> 
    4  
    5 <?php if ($editable): ?> 
    6  
    7         <?php slot('a-cancel') ?> 
    8                 <?php if (0): ?>         
    9                         <li class="a-controls-item cancel"> 
    10                                 <a href="#" class="a-btn a-cancel a-cancel-area" title="<?php echo __('Cancel', null, 'apostrophe') ?>"><?php echo __('Cancel', null, 'apostrophe') ?></a>                                       
    11                         </li> 
    12                 <?php endif ?> 
    13         <?php end_slot() ?> 
    14  
    15         <?php slot('a-history-controls') ?> 
    16         <li class="a-controls-item history"> 
     3<?php slot('a-history-controls') ?> 
     4        <li> 
    175          <?php $moreAjax = "jQuery.ajax({type:'POST',dataType:'html',success:function(data, textStatus){jQuery('#a-history-items-$pageid-$name').html(data);},url:'/admin/a/history/id/".$page->id."/name/$name/all/1'}); return false;"; ?> 
    186                <?php $history_button_style = sfConfig::get('app_a_history_button_style', "no-label big"); ?> 
     
    2917                )); ?>                                   
    3018        </li> 
    31         <?php end_slot() ?> 
    32  
    33 <?php endif ?> 
     19<?php end_slot() ?> 
    3420 
    3521<?php if (!$refresh): ?> 
    36   <?php // Wraps the whole thing, including the area controls ?> 
    37   <?php // Existing CSS code often targets the old area IDs, which were a-area-$name. Since ?> 
    38   <?php // we now have multiple areas with the same name coming from separate virtual pages, ?> 
    39   <?php // we need the page ID in the DOM ID, which means it can't be used in CSS. Instead we ?> 
    40   <?php // provide a-area-$name as a class, which should make it easy to change your CSS rules. ?> 
    41   <?php // It is also possible to explicitly pass an area-class option to an area (or singleton slot). ?> 
     22 
    4223  <div id="a-area-<?php echo "$pageid-$name" ?>" class="a-area <?php echo isset($options['area-class']) ? $options['area-class'] : "a-area-$name" ?>"> 
    4324     
    44   <?php // The area controls ?> 
     25  <?php // Area Controls ?> 
    4526  <?php if ($editable): ?> 
    4627    <?php if ($infinite): ?> 
    4728 
    48                 <ul class="a-controls a-area-controls"> 
     29                <ul class="a-ui a-controls a-area-controls"> 
    4930 
    5031                <?php # Slot Controls ?> 
    51                         <li class="a-controls-item slots"> 
     32                        <li> 
    5233                                <?php $addslot_button_style = sfConfig::get('app_a_addslot_button_style', "big"); ?>                             
    5334                                <?php echo link_to_function(__('Add Content', null, 'apostrophe'), "", array('class' => 'a-btn icon a-add a-add-slot '.$addslot_button_style, 'id' => 'a-add-slot-'.$pageid.'-'.$name, )) ?> 
     
    5536                <?php include_partial('a/addSlot', array('id' => $page->id, 'name' => $name, 'options' => $options)) ?> 
    5637                                </ul> 
    57                                  
    5838                        </li>    
    5939                        <?php include_slot('a-history-controls') ?> 
    60                         <?php include_slot('a-cancel') ?> 
    6140                </ul> 
    6241    <?php endif ?> 
     
    6746 
    6847<?php endif ?> 
    69  
    70 <?php $i = 0 ?> 
    7148 
    7249<?php // On an AJAX refresh we are updating a-slots-$pageid-$name, ?> 
     
    7956 
    8057<?php // Loop through all of the slots in the area ?> 
    81 <?php foreach ($slots as $permid => $slot): ?> 
    82    <?php if ($infinite): ?> 
    83         <?php if (isset($options['type_options'][$slot->type])): ?> 
     58<?php $i = 0; foreach ($slots as $permid => $slot): ?> 
     59 
     60        <?php if ($infinite): ?> 
     61                <?php if (isset($options['type_options'][$slot->type])): ?> 
    8462          <?php $slotOptions = $options['type_options'][$slot->type]; ?> 
    8563        <?php else: ?> 
     
    8967        <?php $slotOptions = $options ?> 
    9068  <?php endif ?> 
    91   <?php $outlineEditableClass = "" ?> 
    92   <?php if ($editable && ((isset($slotOptions['outline_editable']) && $slotOptions['outline_editable']) || $slot->isOutlineEditable())): ?> 
    93     <?php $outlineEditableClass = "a-slot-is-editable" ?> 
    94   <?php endif ?> 
    95  <?php // Generate the content of the CMS slot early and capture it to a ?> 
    96  <?php // Symfony slot so we can insert it at an appropriate point... and we ?> 
    97  <?php // will also insert its slot-specific controls via a separate ?> 
    98  <?php // a-slot-controls-$pageid-$name-$permid slot that the slot implementation ?> 
    99  <?php // provides for us ?> 
    10069 
    10170 <?php slot("a-slot-content-$pageid-$name-$permid") ?> 
     
    10372 <?php end_slot() ?> 
    10473 
    105  <?php // Wraps an individual slot, with its controls ?> 
    106         <div class="a-slot <?php echo $slot->getEffectiveVariant($slotOptions) ?> <?php echo $slot->type ?> <?php echo $outlineEditableClass ?><?php echo ($slot->isNew())? ' a-new-slot':'' ?>" id="a-slot-<?php echo "$pageid-$name-$permid" ?>"> 
    107     <?php // John shouldn't we suppress this entirely if !$editable? ?> 
    108     <?php // Controls for that individual slot ?> 
     74        <!-- START SLOT --> 
     75        <div class="a-slot <?php echo $slot->getEffectiveVariant($slotOptions) ?> <?php echo $slot->type ?><?php echo ($slot->isNew())? ' a-new-slot':'' ?>" id="a-slot-<?php echo "$pageid-$name-$permid" ?>"> 
     76                <?php // Slot Controls ?> 
    10977    <?php if ($editable): ?> 
    110                 <ul class="a-controls a-slot-controls">          
     78                <ul class="a-ui a-controls a-slot-controls">             
    11179      <?php if ($infinite): ?> 
    11280          <?php if ($i > 0): ?> 
    113                                                 <li class="move-up"> 
     81                                                <li> 
    11482            <?php echo jq_link_to_remote(__('Move', null, 'apostrophe'), array( 
    11583                "url" => "a/moveSlot?" .http_build_query(array( 
     
    12694                                                </li> 
    12795          <?php endif ?> 
    128  
    12996          <?php if (($i + 1) < count($slots)): ?> 
    130                                                 <li class="move-down"> 
     97                                                <li> 
    13198            <?php echo jq_link_to_remote(__('Move', null, 'apostrophe'), array( 
    13299                "url" => "a/moveSlot?" .http_build_query(array( 
     
    149116                        <?php if (!$infinite): ?> 
    150117                          <?php include_slot('a-history-controls') ?> 
    151                                 <?php include_slot('a-cancel') ?> 
    152118                        <?php endif ?> 
    153119 
    154120      <?php if ($infinite): ?> 
    155         <li class="delete"> 
     121                        <?php // Tom: Just a quick note about this -- Enabling the delete button for singleton slot works, it just clears out the value for that slot instead of deleting the slot. ?> 
     122        <li> 
    156123                                        <?php $delete_button_style = sfConfig::get('app_a_delete_button_style', "no-label"); ?> 
    157124          <?php echo jq_link_to_remote(__('Delete', null, 'apostrophe'), array( 
     
    172139                 
    173140  <?php endif ?> 
    174         <?php // End controls for this individual slot ?>                
     141        <?php // End Slot Controls ?>            
    175142                                 
    176143    <?php // Wraps the actual content - edit and normal views for this individual slot ?> 
     
    179146      <?php include_slot("a-slot-content-$pageid-$name-$permid") ?> 
    180147        </div> 
    181         </div> 
     148        </div><!-- END SLOT --> 
     149 
    182150<?php $i++; endforeach ?> 
    183151 
     
    186154</div> <?php // Closes the div wrapping all of the slots AND the area controls ?> 
    187155<?php endif ?> 
    188 <!-- END SLOT --> 
    189  
    190156 
    191157