- Timestamp:
- 07/27/10 13:49:40 (22 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
plugins/apostrophePlugin/branches/features/css/modules/a/templates/_area.php
r1719 r1859 1 1 <?php use_helper('a', 'jQuery', 'I18N') ?> 2 2 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> 17 5 <?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;"; ?> 18 6 <?php $history_button_style = sfConfig::get('app_a_history_button_style', "no-label big"); ?> … … 29 17 )); ?> 30 18 </li> 31 <?php end_slot() ?> 32 33 <?php endif ?> 19 <?php end_slot() ?> 34 20 35 21 <?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 42 23 <div id="a-area-<?php echo "$pageid-$name" ?>" class="a-area <?php echo isset($options['area-class']) ? $options['area-class'] : "a-area-$name" ?>"> 43 24 44 <?php // The area controls ?>25 <?php // Area Controls ?> 45 26 <?php if ($editable): ?> 46 27 <?php if ($infinite): ?> 47 28 48 <ul class="a- controls a-area-controls">29 <ul class="a-ui a-controls a-area-controls"> 49 30 50 31 <?php # Slot Controls ?> 51 <li class="a-controls-item slots">32 <li> 52 33 <?php $addslot_button_style = sfConfig::get('app_a_addslot_button_style', "big"); ?> 53 34 <?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, )) ?> … … 55 36 <?php include_partial('a/addSlot', array('id' => $page->id, 'name' => $name, 'options' => $options)) ?> 56 37 </ul> 57 58 38 </li> 59 39 <?php include_slot('a-history-controls') ?> 60 <?php include_slot('a-cancel') ?>61 40 </ul> 62 41 <?php endif ?> … … 67 46 68 47 <?php endif ?> 69 70 <?php $i = 0 ?>71 48 72 49 <?php // On an AJAX refresh we are updating a-slots-$pageid-$name, ?> … … 79 56 80 57 <?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])): ?> 84 62 <?php $slotOptions = $options['type_options'][$slot->type]; ?> 85 63 <?php else: ?> … … 89 67 <?php $slotOptions = $options ?> 90 68 <?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 ?>100 69 101 70 <?php slot("a-slot-content-$pageid-$name-$permid") ?> … … 103 72 <?php end_slot() ?> 104 73 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 ?> 109 77 <?php if ($editable): ?> 110 <ul class="a- controls a-slot-controls">78 <ul class="a-ui a-controls a-slot-controls"> 111 79 <?php if ($infinite): ?> 112 80 <?php if ($i > 0): ?> 113 <li class="move-up">81 <li> 114 82 <?php echo jq_link_to_remote(__('Move', null, 'apostrophe'), array( 115 83 "url" => "a/moveSlot?" .http_build_query(array( … … 126 94 </li> 127 95 <?php endif ?> 128 129 96 <?php if (($i + 1) < count($slots)): ?> 130 <li class="move-down">97 <li> 131 98 <?php echo jq_link_to_remote(__('Move', null, 'apostrophe'), array( 132 99 "url" => "a/moveSlot?" .http_build_query(array( … … 149 116 <?php if (!$infinite): ?> 150 117 <?php include_slot('a-history-controls') ?> 151 <?php include_slot('a-cancel') ?>152 118 <?php endif ?> 153 119 154 120 <?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> 156 123 <?php $delete_button_style = sfConfig::get('app_a_delete_button_style', "no-label"); ?> 157 124 <?php echo jq_link_to_remote(__('Delete', null, 'apostrophe'), array( … … 172 139 173 140 <?php endif ?> 174 <?php // End controls for this individual slot?>141 <?php // End Slot Controls ?> 175 142 176 143 <?php // Wraps the actual content - edit and normal views for this individual slot ?> … … 179 146 <?php include_slot("a-slot-content-$pageid-$name-$permid") ?> 180 147 </div> 181 </div> 148 </div><!-- END SLOT --> 149 182 150 <?php $i++; endforeach ?> 183 151 … … 186 154 </div> <?php // Closes the div wrapping all of the slots AND the area controls ?> 187 155 <?php endif ?> 188 <!-- END SLOT -->189 190 156 191 157

