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

Changeset 1859

Show
Ignore:
Timestamp:
07/27/10 13:49:40 (19 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

Location:
plugins/apostrophePlugin/branches/features/css
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/branches/features/css/lib/helper/aHelper.php

    r1717 r1859  
    1717  if (sfConfig::get('app_a_use_bundled_stylesheet', true)) 
    1818  { 
    19     $response->addStylesheet('/apostrophePlugin/css/a.css', 'first'); 
     19    $response->addStylesheet('/apostrophePlugin/css/a-reset.css'); 
     20    $response->addStylesheet('/apostrophePlugin/css/a-utility.css'); 
     21    $response->addStylesheet('/apostrophePlugin/css/a-forms.css'); 
     22    $response->addStylesheet('/apostrophePlugin/css/a-buttons.css'); 
     23    $response->addStylesheet('/apostrophePlugin/css/a-navigation.css'); 
     24    $response->addStylesheet('/apostrophePlugin/css/a-components.css'); 
     25    $response->addStylesheet('/apostrophePlugin/css/a-area-slots.css'); 
     26    $response->addStylesheet('/apostrophePlugin/css/a-engines.css'); 
     27    $response->addStylesheet('/apostrophePlugin/css/a-admin.css'); 
     28    $response->addStylesheet('/apostrophePlugin/css/a-colors.css'); 
    2029  } 
    2130 
  • 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 
  • plugins/apostrophePlugin/branches/features/css/modules/a/templates/_globalTools.php

    r1703 r1859  
    77 
    88<div id="a-global-toolbar"> 
    9   <?php // All logged in users, including guests with no admin abilities, need access to the ?> 
    10   <?php // logout button. But if you have no legitimate admin roles, you shouldn't see the ?> 
    11   <?php // apostrophe or the global buttons ?> 
    129 
    13   <?php $buttons = aTools::getGlobalButtons() ?> 
    14   <?php $page = aTools::getCurrentPage() ?> 
    15   <?php $pageEdit = $page && $page->userHasPrivilege('edit') ?> 
    16   <?php $cmsAdmin = $sf_user->hasCredential('cms_admin') ?> 
     10        <ul class="a-ui a-controls"> 
    1711 
    18   <?php if ($cmsAdmin || count($buttons) || $pageEdit): ?> 
     12          <?php if ($cmsAdmin || count($buttons) || $pageEdit): ?> 
    1913 
    20         <?php // The Apostrophe ?> 
    21         <div class="a-global-toolbar-apostrophe"> 
    22                 <?php echo link_to(__('Apostrophe Now', null, 'apostrophe'),'@homepage', array('id' => 'the-apostrophe')) ?> 
    23                 <ul class="a-global-toolbar-buttons a-controls"> 
     14                        <li><?php echo link_to(__('Apostrophe Now', null, 'apostrophe'),'@homepage', array('id' => 'the-apostrophe')) ?></li> 
    2415 
    25                         <?php foreach ($buttons as $button): ?> 
    26                           <?php if ($button->getTargetEnginePage()): ?> 
    27                             <?php aRouteTools::pushTargetEnginePage($button->getTargetEnginePage()) ?> 
    28                           <?php endif ?> 
    29                           <li><?php echo link_to(__($button->getLabel(), null, 'apostrophe'), $button->getLink(), array('class' => 'a-btn icon ' . $button->getCssClass())) ?></li> 
    30                         <?php endforeach ?> 
     16                        <?php foreach ($buttons as $button): ?> 
     17                                <?php if ($button->getTargetEnginePage()): ?><?php aRouteTools::pushTargetEnginePage($button->getTargetEnginePage()) ?><?php endif ?> 
     18                                <li><?php echo link_to(__($button->getLabel(), null, 'apostrophe'), $button->getLink(), array('class' => 'a-btn icon ' . $button->getCssClass())) ?></li> 
     19                        <?php endforeach ?> 
    3120 
    32                         <?php if ($page && (!$page->admin) && $cmsAdmin && $pageEdit): ?>                        
    33                                         <li> 
    34                                                 <a href="#" onclick="return false;" class="a-btn icon a-page-settings" id="a-page-settings-button">Page Settings</a>                     
    35                                                 <div id="a-page-settings" class="a-page-settings-menu dropshadow"></div> 
    36                                         </li>                            
     21                        <?php if ($page && (!$page->admin) && $cmsAdmin && $pageEdit): ?>                        
     22                                <li> 
     23                                        <a href="#" onclick="return false;" class="a-btn icon a-page-settings" id="a-page-settings-button">Page Settings</a>                     
     24                                        <div id="a-page-settings" class="a-page-settings-menu dropshadow"></div> 
     25                                </li>                            
    3726 
    38                                         <?php // Remove the Add Page Button if we have reached our max depth, max peers, or if it is an engine page ?> 
    39                                         <?php $maxPageLevels = (sfConfig::get('app_a_max_page_levels'))? sfConfig::get('app_a_max_page_levels') : 0; ?><?php // Your Site Tree can only get so deep ?> 
    40                                         <?php $maxChildPages = (sfConfig::get('app_a_max_children_per_page'))? sfConfig::get('app_a_max_children_per_page') : 0; ?><?php // Your Site Tree can only get so wide ?> 
    41                                         <?php if (!(($maxPageLevels && ($page->getLevel() == $maxPageLevels)) || ($maxChildPages && (count($page->getChildren()) == $maxChildPages)) || strlen($page->getEngine()))): ?> 
    42                                                 <li><?php include_component('a', 'createPage', array('page' => $page, 'edit' => $page->userHasPrivilege('edit'))); ?></li> 
    43                                         <?php endif ?> 
     27                                <?php // Remove the Add Page Button if we have reached our max depth, max peers, or if it is an engine page ?> 
     28                                <?php $maxPageLevels = (sfConfig::get('app_a_max_page_levels'))? sfConfig::get('app_a_max_page_levels') : 0; ?><?php // Your Site Tree can only get so deep ?> 
     29                                <?php $maxChildPages = (sfConfig::get('app_a_max_children_per_page'))? sfConfig::get('app_a_max_children_per_page') : 0; ?><?php // Your Site Tree can only get so wide ?> 
     30                                <?php if (!(($maxPageLevels && ($page->getLevel() == $maxPageLevels)) || ($maxChildPages && (count($page->getChildren()) == $maxChildPages)) || strlen($page->getEngine()))): ?> 
     31                                        <li><?php include_component('a', 'createPage', array('page' => $page, 'edit' => $page->userHasPrivilege('edit'))); ?></li> 
     32                                <?php endif ?> 
    4433 
    45                                 <?php endif ?> 
    46                 </ul> 
    47         </div> 
     34                        <?php endif ?> 
     35                <?php endif ?> 
    4836 
    49         <?php endif ?> 
     37                <li class="a-login"> 
     38                        <?php include_partial("a/login") ?> 
     39                </li>            
    5040 
    51         <?php // Login / Logout ?> 
    52         <div class="a-global-toolbar-login a-login"> 
    53                 <?php include_partial("a/login") ?> 
    54         </div>           
     41        </ul> 
    5542  
    5643</div> 
     
    8168                        });      
    8269                }); 
    83                  
    8470        }); 
    8571</script> 
  • plugins/apostrophePlugin/branches/features/css/web/css/a-area-slots.css

    r1849 r1859  
    358358-------------------------------------*/ 
    359359 
    360 ul.a-controls 
     360.a-ui.a-controls 
    361361{  
    362362position: relative; 
     
    366366} 
    367367 
    368 ul.a-controls li 
     368.a-ui.a-controls li 
    369369{ /* All controls buttons are wrapped in a list. */ 
    370370float: left; 
     
    378378} 
    379379 
    380 ul.a-controls li.last 
     380.a-ui.a-controls li.last 
    381381{ /* .last option has no margin */ 
    382382        margin: 0 0 2px 0 !important; 
    383383} 
    384384 
    385 .a-area > ul.a-controls 
     385.a-area > .a-ui.a-controls 
    386386{  
    387387margin: 0 0 10px; 
     
    389389} 
    390390 
    391 .a-area.singleton > ul.a-controls 
     391.a-area.singleton > .a-ui.a-controls 
    392392{  
    393393position: absolute; 
     
    398398} 
    399399 
    400 .a-area.singleton.aRichText > ul.a-controls, 
    401 .a-area.singleton.aText > ul.a-controls, 
    402 .a-area.singleton.aBlog > ul.a-controls, 
    403 .a-area.singleton.aBlogSingle > ul.a-controls, 
    404 .a-area.singleton.aEvent > ul.a-controls, 
    405 .a-area.singleton.aEventSingle > ul.a-controls 
     400.a-area.singleton.aRichText > .a-ui.a-controls, 
     401.a-area.singleton.aText > .a-ui.a-controls, 
     402.a-area.singleton.aBlog > .a-ui.a-controls, 
     403.a-area.singleton.aBlogSingle > .a-ui.a-controls, 
     404.a-area.singleton.aEvent > .a-ui.a-controls, 
     405.a-area.singleton.aEventSingle > .a-ui.a-controls 
    406406{ /* Some Singleton Slots don't want Area Controls to sit on top of their content */ 
    407407position: relative; 
     
    444444/* Options Element -- This creates a box for menu options and for slot options */ 
    445445 
    446 .a-options 
     446.a-ui .a-options 
    447447{  
    448448padding: 35px 5px 2px 5px;