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

Changeset 2171

Show
Ignore:
Timestamp:
09/09/10 17:11:12 (17 months ago)
Author:
johnnyoffline
Message:

1. Moved aIE6() to apostrophe.IE6()
2. Moved aAccordion() to apostrophe.accordion()
3. Integrated accordion into page settings

Location:
plugins/apostrophePlugin/trunk
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/trunk/modules/a/templates/_allPrivileges.php

    r2135 r2171  
    99        <h3><?php echo a_('Page Permissions') ?></h3> 
    1010 
    11         <div class="a-page-permissions content"> 
    12                 <p class="a-form-help-text"><?php echo a_('Select Groups and Individuals to edit this page and it’s children') ?></p> 
    13                 <div class="a-page-permissions-section a-page-permissions-by-group"> 
    14                   <?php include_partial('a/privileges',  
    15                     array('form' => $form, 'widget' => 'group_editors', 
    16                       'label' => 'Editor Groups', 'inherited' => $inherited['group_edit'], 
    17                       'admin' => $admin['group_edit'])) ?> 
    18                   <?php include_partial('a/privileges',  
    19                     array('form' => $form, 'widget' => 'group_managers', 
    20                       'label' => 'Manager Groups', 'inherited' => $inherited['group_manage'], 
    21                       'admin' => $admin['group_manage'])) ?> 
    22                 </div> 
    23                 <div class="a-page-permissions-section a-page-permissions-by-user"> 
    24                   <?php include_partial('a/privileges',  
    25                     array('form' => $form, 'widget' => 'editors', 
    26                       'label' => 'Individual Editors', 'inherited' => $inherited['edit'], 
    27                       'admin' => $admin['edit'])) ?> 
    28                   <?php include_partial('a/privileges',  
    29                     array('form' => $form, 'widget' => 'managers', 
    30                       'label' => 'Individual Managers', 'inherited' => $inherited['manage'], 
    31                       'admin' => $admin['manage'])) ?> 
     11        <div class="a-accordion-content"> 
     12                <div class="a-form-row a-page-permissions"> 
     13                        <p class="a-form-help-text"><?php echo a_('Select Groups and Individuals to edit this page and it’s children') ?></p> 
     14                        <div class="a-page-permissions-section a-page-permissions-by-group"> 
     15                          <?php include_partial('a/privileges',  
     16                            array('form' => $form, 'widget' => 'group_editors', 
     17                              'label' => 'Editor Groups', 'inherited' => $inherited['group_edit'], 
     18                              'admin' => $admin['group_edit'])) ?> 
     19                          <?php include_partial('a/privileges',  
     20                            array('form' => $form, 'widget' => 'group_managers', 
     21                              'label' => 'Manager Groups', 'inherited' => $inherited['group_manage'], 
     22                              'admin' => $admin['group_manage'])) ?> 
     23                        </div> 
     24                        <div class="a-page-permissions-section a-page-permissions-by-user"> 
     25                          <?php include_partial('a/privileges',  
     26                            array('form' => $form, 'widget' => 'editors', 
     27                              'label' => 'Individual Editors', 'inherited' => $inherited['edit'], 
     28                              'admin' => $admin['edit'])) ?> 
     29                          <?php include_partial('a/privileges',  
     30                            array('form' => $form, 'widget' => 'managers', 
     31                              'label' => 'Individual Managers', 'inherited' => $inherited['manage'], 
     32                              'admin' => $admin['manage'])) ?> 
     33                        </div> 
    3234                </div> 
    3335        </div> 
  • plugins/apostrophePlugin/trunk/modules/a/templates/layout.php

    r2160 r2171  
    1616        <?php a_include_javascripts() ?> 
    1717        <link rel="shortcut icon" href="/favicon.ico" /> 
    18  
     18         
    1919        <!--[if lt IE 7]> 
    20         <script type="text/javascript" charset="utf-8"> 
    21                 $(document).ready(function() { 
    22                         aIE6(<?php echo ($sf_user->isAuthenticated())? 'true':'false' ?>, <?php echo json_encode(__('You are using IE6! That is just awful! Apostrophe does not support editing using Internet Explorer 6. Why don\'t you try upgrading? <a href="http://www.getfirefox.com">Firefox</a> <a href="http://www.google.com/chrome">Chrome</a>      <a href="http://www.apple.com/safari/download/">Safari</a> <a href="http://www.microsoft.com/windows/internet-explorer/worldwide-sites.aspx">IE8</a>', null, 'apostrophe')) ?>); 
    23                 });              
    24         </script> 
     20                <script type="text/javascript" charset="utf-8"> 
     21                        $(document).ready(function() { 
     22                                apostrophe.IE6({'authenticated':<?php echo ($sf_user->isAuthenticated())? 'true':'false' ?>, 'message':<?php echo json_encode(__('You are using IE6! That is just awful! Apostrophe does not support editing using Internet Explorer 6. Why don\'t you try upgrading? <a href="http://www.getfirefox.com">Firefox</a> <a href="http://www.google.com/chrome">Chrome</a>         <a href="http://www.apple.com/safari/download/">Safari</a> <a href="http://www.microsoft.com/windows/internet-explorer/worldwide-sites.aspx">IE8</a>', null, 'apostrophe')) ?>}); 
     23                        }); 
     24                </script> 
    2525        <![endif]-->     
    2626 
  • plugins/apostrophePlugin/trunk/modules/a/templates/settingsSuccess.php

    r2160 r2171  
    2929        <?php echo $form->renderGlobalErrors() ?> 
    3030 
    31         <div class="a-options-section"> 
     31        <div class="a-options-section open"> 
    3232                <h3>Title &amp; Permalink</h3> 
    3333                <div class="a-form-row a-page-title"> 
     
    4444                <?php if (isset($form['slug'])): ?> 
    4545                  <div class="a-form-row a-page-slug"> 
    46                                 <h4><?php echo $form['slug']->renderLabel(__('Permalink', array(), 'apostrophe')) ?></h4> 
     46                                <h4><?php echo $form['slug']->renderLabel('http://'.$_SERVER['HTTP_HOST']) ?></h4> 
    4747                                <div class="a-form-field"> 
    4848                        <?php echo $form['slug'] ?> 
     
    5050                    <?php echo $form['slug']->renderError() ?> 
    5151                  </div> 
    52                 <?php elseif (0): ?> 
    53                         <?php // If It's the ho ?> 
    5452                <?php endif ?> 
    5553 
     
    5856        <hr/> 
    5957         
    60         <div class="a-options-section"> 
     58        <div class="a-options-section a-accordion"> 
    6159                 
    6260                <h3>Options</h3> 
    6361                 
    64                 <div class="a-form-row engine a-page-type"> 
    65                         <h4><?php echo $form['engine']->renderLabel(__('Page Type', array(), 'apostrophe')) ?></h4> 
    66                         <div class="a-form-field"> 
    67                         <?php echo $form['engine']->render(array('onChange' => 'aUpdateEngineAndTemplate()')) ?> 
     62                <div class="a-accordion-content"> 
     63                         
     64                        <div class="a-form-row engine a-page-type"> 
     65                                <h4><?php echo $form['engine']->renderLabel(__('Page Type', array(), 'apostrophe')) ?></h4> 
     66                                <div class="a-form-field"> 
     67                                <?php echo $form['engine']->render(array('onChange' => 'aUpdateEngineAndTemplate()')) ?> 
     68                                </div> 
     69                          <?php echo $form['engine']->renderError() ?> 
    6870                        </div> 
    69                   <?php echo $form['engine']->renderError() ?> 
     71 
     72                        <div class="a-form-row a-edit-page-template"> 
     73                                <h4><?php echo $form['template']->renderLabel(__('Page Template', array(), 'apostrophe')) ?></h4> 
     74                                <div class="a-form-field"> 
     75                                <?php echo $form['template'] ?> 
     76                                </div> 
     77                          <?php echo $form['template']->renderError() ?> 
     78                        </div> 
     79 
     80                  <?php if (isset($engineSettingsPartial)): ?> 
     81                        <div class="a-form-row a-engine-page-settings" id="a_settings_engine_settings"> 
     82                            <?php include_partial($engineSettingsPartial, array('form' => $engineForm)) ?> 
     83                        </div> 
     84                <?php endif ?> 
     85 
     86                        <div class="a-form-row status"> 
     87                          <h4><label><?php echo __('Page Status', null, 'apostrophe') ?></label></h4> 
     88                        <div class="a-page-settings-status"> 
     89                                        <?php echo $form['archived'] ?> 
     90                                        <?php if(isset($form['cascade_archived'])): ?> 
     91                                                <?php echo $form['cascade_archived'] ?> <?php echo __('Cascade status changes to children', null, 'apostrophe') ?> 
     92                                        <?php endif ?>  
     93                                </div> 
     94                        </div>                   
     95 
     96                        <div class="a-form-row privacy"> 
     97                          <h4><label><?php echo __('Page Privacy', null, 'apostrophe') ?></label></h4> 
     98                                <div class="a-page-settings-status"> 
     99                                <?php echo $form['view_is_secure'] ?> 
     100                                        <?php if(isset($form['cascade_view_is_secure'])): ?> 
     101                                                <?php echo $form['cascade_view_is_secure'] ?> <?php echo __('Cascade privacy changes to children', null, 'apostrophe') ?> 
     102                                        <?php endif ?>  
     103                                </div> 
     104                        </div> 
     105 
    70106                </div> 
    71  
    72                 <div class="a-form-row a-edit-page-template"> 
    73                         <h4><?php echo $form['template']->renderLabel(__('Page Template', array(), 'apostrophe')) ?></h4> 
    74                         <div class="a-form-field"> 
    75                         <?php echo $form['template'] ?> 
    76                         </div> 
    77                   <?php echo $form['template']->renderError() ?> 
    78                 </div> 
    79  
    80           <?php if (isset($engineSettingsPartial)): ?> 
    81                 <div id="a_settings_engine_settings"> 
    82                     <?php include_partial($engineSettingsPartial, array('form' => $engineForm)) ?> 
    83                 </div> 
    84         <?php endif ?> 
    85  
    86                 <div class="a-form-row status"> 
    87                   <h4><label><?php echo __('Page Status', null, 'apostrophe') ?></label></h4> 
    88                         <div class="a-page-settings-status"> 
    89                             <?php echo $form['archived'] ?> 
    90           <?php if(isset($form['cascade_archived'])): ?> 
    91             <?php // If you want your <em> back here, do it in the translation file ?> 
    92             <?php echo $form['cascade_archived'] ?> <?php echo __('Cascade status changes to children', null, 'apostrophe') ?> 
    93           <?php endif ?>  
    94                                 </div> 
    95                 </div>                   
    96  
    97                 <div class="a-form-row privacy"> 
    98                   <h4><label><?php echo __('Page Privacy', null, 'apostrophe') ?></label></h4> 
    99                         <div class="a-page-settings-status"> 
    100                                         <?php echo $form['view_is_secure'] ?> 
    101                                         <?php if(isset($form['cascade_view_is_secure'])): ?> 
    102               <?php echo $form['cascade_view_is_secure'] ?> <?php echo __('Cascade privacy changes to children', null, 'apostrophe') ?> 
    103           <?php endif ?>  
    104                                 </div> 
    105                 </div> 
    106  
    107107        </div> 
    108108 
    109109        <hr/> 
    110110 
    111         <div class="a-options-section"> 
     111        <div class="a-options-section a-accordion"> 
    112112 
    113113                <h3>Tags &amp; Metadata</h3> 
    114114 
    115                 <div class="a-form-row keywords"> 
    116                         <div class="a-form-field"> 
    117                                 <?php echo $form['tags'] ?> 
     115                <div class="a-accordion-content">                        
     116                         
     117                        <div class="a-form-row keywords"> 
     118                                <div class="a-form-field"> 
     119                                        <?php echo $form['tags'] ?> 
     120                                </div> 
     121                                <?php echo $form['tags']->renderError() ?> 
     122                                <?php a_js_call('aInlineTaggableWidget(?, ?)', '.tags-input', array('popular-tags' => $popularTags, 'existing-tags' => $existingTags, 'typeahead-url' => url_for('taggableComplete/complete'), 'tagsLabel' => 'Page Tags')) ?> 
    118123                        </div> 
    119                         <?php echo $form['tags']->renderError() ?> 
    120                         <?php a_js_call('aInlineTaggableWidget(?, ?)', '.tags-input', array('popular-tags' => $popularTags, 'existing-tags' => $existingTags, 'typeahead-url' => url_for('taggableComplete/complete'), 'tagsLabel' => 'Page Tags')) ?> 
     124 
     125                        <div class="a-form-row meta-description"> 
     126                                <h4 class="a-block"><?php echo $form['meta_description']->renderLabel(__('Meta Description', array(), 'apostrophe')) ?></h4> 
     127                                <div class="a-form-field"> 
     128                                        <?php echo $form['meta_description'] ?> 
     129                                </div> 
     130                                <?php echo $form['meta_description']->renderError() ?> 
     131                        </div> 
     132                         
    121133                </div> 
    122  
    123                 <div class="a-form-row meta-description"> 
    124                         <h4 class="a-block"><?php echo $form['meta_description']->renderLabel(__('Meta Description', array(), 'apostrophe')) ?></h4> 
    125                         <div class="a-form-field"> 
    126                                 <?php echo $form['meta_description'] ?> 
    127                         </div> 
    128                         <?php echo $form['meta_description']->renderError() ?> 
    129                 </div> 
    130                  
    131134        </div> 
    132135 
    133136        <hr/> 
    134137         
    135         <div class="a-options-section"> 
     138        <div class="a-options-section a-accordion"> 
    136139    <?php include_partial('a/allPrivileges', array('form' => $form, 'inherited' => $inherited, 'admin' => $admin)) ?> 
    137140        </div> 
     
    153156</form> 
    154157<?php a_js_call('apostrophe.updateEngineAndTemplate(?)', array('url' => url_for('a/engineSettings'), 'id' => $page->id)) ?> 
     158<?php a_js_call('apostrophe.accordion(?)', array('accordion_toggle' => '.a-options-section:not(".open") h3')) ?> 
     159 
    155160<?php // All AJAX actions that use a_js_call must do this since they have no layout to do it for them ?> 
    156  
    157161<script src="/sfJqueryReloadedPlugin/js/plugins/jquery.autocomplete.js"></script> 
    158162<script src="/sfDoctrineActAsTaggablePlugin/js/pkTagahead.js"></script> 
  • plugins/apostrophePlugin/trunk/web/css/a-components.css

    r2169 r2171  
    351351overflow: hidden; 
    352352padding: 5px; 
    353 margin: 5px 0; 
     353margin: 8px 0; 
    354354width: auto; 
    355355-moz-border-radius: 2px; 
     
    404404.a-ui.a-page-form .a-page-settings-section .content { margin: 0 16px; float: left; } 
    405405 
    406 .a-ui.a-page-form .a-page-settings-section h4 
    407 { 
    408         background: url(/apostrophePlugin/images/a-icon-arrow-toggle.png) -6px -40px no-repeat; 
    409         cursor: pointer; 
    410         text-indent: 16px; 
    411         line-height: 20px; 
    412         width: 100%; 
    413         position: relative; 
    414         margin: 0 0 5px 0; 
    415 } 
    416  
    417 .a-ui.a-page-form .a-page-settings-section h4:hover { background-position: -6px 0; } 
    418 .a-ui.a-page-form .a-page-settings-section.open h4 { background-position: -6px -20px; } 
    419 .a-ui.a-page-form .a-page-settings-section.open h4:hover { background-position: -6px -60px;     } 
     406.a-ui.a-page-form h4 { margin: 5px 0; } 
    420407 
    421408.a-ui .a-page-settings-status { float: left; width: 230px; } 
     
    440427.a-page-settings-section.page-submit a.a-btn.a-cancel { float: left !important; clear: none !important; margin-left: 2px; } 
    441428.a-page-settings-section.page-submit a.a-btn.a-delete { float: right !important; clear: none; } 
     429 
     430.a-ui.a-page-form .a-accordion-toggle 
     431{ 
     432background: url(/apostrophePlugin/images/a-icon-arrow-toggle.png) -6px -40px no-repeat; 
     433cursor: pointer; 
     434clear: both; 
     435text-indent: 16px; 
     436line-height: 20px; 
     437-webkit-user-select:none; 
     438-moz-user-select:none; 
     439} 
     440 
     441.a-ui.a-page-form .a-accordion-toggle.hover, 
     442.a-ui.a-page-form .a-accordion-toggle:hover { background-position: -6px 0px; } 
     443 
     444.a-ui.a-page-form .open .a-accordion-toggle { background-position: -6px -20px; } 
     445 
     446.a-ui.a-page-form .open .a-accordion-toggle.hover, 
     447.a-ui.a-page-form .open .a-accordion-toggle:hover { background-position: -6px -60px; } 
     448 
    442449 
    443450/* Create Page Form 
     
    10421049} 
    10431050 
    1044 .a-inline-taggable-widget-tag-container.a-popular .a-tag 
    1045 { 
     1051.a-inline-taggable-widget-tag-container.a-popular-tags .a-tag 
     1052{ 
     1053        display: block; 
    10461054        clear: both; 
    10471055} 
  • plugins/apostrophePlugin/trunk/web/css/a-forms.css

    r2169 r2171  
    1717text-align: left; 
    1818font-weight: normal; 
    19 text-transform: capitalize; 
    2019width: 120px; 
    2120line-height: 20px; 
  • plugins/apostrophePlugin/trunk/web/css/a-utility.css

    r2135 r2171  
    3333.a-disabled, .a-disabled * { cursor: default !important; opacity: 0.65; } 
    3434 
    35 /* Accordion works with aAccordion() in aUI.js */ 
    36 .a-accordion .content { display: none; }  
    37 .a-accordion.open .content { display: block; } 
     35/* Accordion works with apostrophe.accordion() */ 
     36.a-accordion .a-accordion-content { display: none; }  
     37.a-accordion.open .a-accordion-content { display: block; } 
     38 
     39.a-accordion-toggle.hover, 
     40.a-accordion-toggle:hover 
     41{ 
     42        cursor: pointer; 
     43        color: #000; 
     44} 
  • plugins/apostrophePlugin/trunk/web/js/a.js

    r2167 r2171  
    286286          } 
    287287         
    288                 aAccordion('.a-page-settings-section-head'); 
     288                // apostrophe.accordion({"accordion_toggle":".a-page-settings-section-head"}); 
     289                 
    289290                aRadioSelect('.a-radio-select', { }); 
    290291                $('#a-page-settings').show(); 
     
    714715        } 
    715716         
     717        this.IE6 = function(options) 
     718        { 
     719                var authenticated = options['authenticated']; 
     720                var message = options['message']; 
     721                // This is called within a conditional comment for IE6 in Apostrophe's layout.php 
     722                if (authenticated) 
     723                { 
     724                        $(document.body).addClass('ie6').prepend('<div id="ie6-warning"><h2>' + message + '</h2></div>');        
     725                } 
     726        } 
     727         
     728        this.accordion = function(options) 
     729        { 
     730                var toggle = options['accordion_toggle']; 
     731                 
     732                if (typeof toggle == "undefined") { 
     733                        apostrophe.log('[Apostrophe] Accordion Toggle is undefined.'); 
     734                } 
     735                else 
     736                { 
     737                        if (typeof toggle == "string") { toggle = $(toggle); } 
     738 
     739                        var container = toggle.parent(); 
     740                        var content = toggle.next(); 
     741 
     742                        container.addClass('a-accordion'); 
     743                        content.addClass('a-accordion-content'); 
     744 
     745                        toggle.each(function() { 
     746                                var t = $(this); 
     747                                t.click(function(event){ 
     748                                        event.preventDefault();                                  
     749                                        t.closest('.a-accordion').toggleClass('open'); 
     750                                }) 
     751                                .hover(function(){ 
     752                                        t.addClass('hover'); 
     753                                },function(){ 
     754                                        t.removeClass('hover'); 
     755                                });                      
     756                        }).addClass('a-accordion-toggle'); 
     757                }; 
     758                 
     759                /* Example Mark-up 
     760                <script> 
     761                        apostrophe.accordion({'accordion_toggle': '.a-accordion-item h3' }); 
     762                </script>  
     763 
     764                BEFORE: 
     765                <div> 
     766                        <h3>Heading</h3> 
     767                        <div>Content</div> 
     768                </div> 
     769 
     770                AFTER: 
     771                <div class="a-accordion"> 
     772                        <h3 class="a-accordion-toggle">Heading</h3> 
     773                        <div class="a-accordion-content">Content</div> 
     774                </div> 
     775                */ 
     776        } 
     777         
    716778}  
    717779 
  • plugins/apostrophePlugin/trunk/web/js/aUI.js

    r2160 r2171  
    7373} 
    7474 
    75 function aIE6(authenticated, message) 
    76 { 
    77         // This is called within a conditional comment for IE6 in Apostrophe's layout.php 
    78         if (authenticated) 
    79         { 
    80                 $(document.body).addClass('ie6').prepend('<div id="ie6-warning"><h2>' + message + '</h2></div>');        
    81         } 
    82  
    83         // Misc IE6 enhancements we want to happen 
    84         $('input[type="checkbox"]').addClass('checkbox'); 
    85         $('input[type="radio"]').addClass('checkbox'); 
    86 } 
    87  
    88 function aAccordion(heading) 
    89 { 
    90         if (typeof heading == "string") { heading = $(heading); } 
    91         heading.click(function() { 
    92                 $(this).parent().toggleClass('open'); 
    93                 return false; 
    94         }).parent().addClass('a-accordion'); 
    95         /* Example Mark-up  
    96         <div class="a-accordion-item"> 
    97                 <h3>Heading</h3>    header = $('.a-accordion-item h3) 
    98                 <div>Content</div> 
    99         </div> 
    100         */ 
    101 } 
    102  
    10375$(document).ready(function(){ 
    10476        aUI();