Changeset 25305

Show
Ignore:
Timestamp:
03/17/10 20:46:33 (6 months ago)
Author:
bergie
Message:

New "object helper" system for displaying editing help in Asgard, fixes #1595

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/ragnaroek/midcom/midcom.core/midcom/helper/_styleloader.php

    r24773 r25305  
    522522                $results['elements']['midcom'][$mc->get_subkey($guid, 'name')] = ''; 
    523523            } 
     524             
     525            if (!isset($results['elements']['midcom']['ROOT'])) 
     526            { 
     527                // There should always be the ROOT element available 
     528                $results['elements']['midcom']['ROOT'] = ''; 
     529            } 
    524530        } 
    525531 
  • branches/ragnaroek/midcom/midcom.core/midcom/services/toolbars.php

    r25299 r25305  
    513513        } 
    514514 
    515         if (   $_MIDCOM->componentloader->is_installed('midcom.admin.styleeditor') 
    516             && $topic->can_do('midcom.admin.folder:template_management') 
    517             && $_MIDCOM->auth->can_user_do('midcom.admin.styleeditor:access', null, 'midcom_admin_styleeditor_viewer')) 
    518         { 
     515        if (   $topic->can_do('midcom.admin.folder:template_management') 
     516            && $_MIDCOM->auth->can_user_do('midgard.admin.asgard:manage_objects', null, 'midgard_admin_asgard_plugin')) 
     517        { 
     518            $enabled = false; 
     519            $styleeditor_url = ''; 
    519520            if ($topic->style != '') 
    520521            { 
    521                 $enabled = true; 
     522                 
     523                $style_id = $_MIDCOM->style->get_style_id_from_path($topic->style); 
     524                if ($style_id) 
     525                { 
     526                    $style = midcom_db_style::get_cached($style_id); 
     527                    if (   $style 
     528                        && $style->guid) 
     529                    { 
     530                        $styleeditor_url = "{$_MIDGARD['self']}__mfa/asgard/object/view/{$style->guid}/"; 
     531                        $enabled = true; 
     532                    } 
     533                } 
    522534            } 
    523             else 
    524             { 
    525                 $enabled = false; 
    526             } 
    527535 
    528536            $toolbar->add_item 
     
    530538                array 
    531539                ( 
    532                     MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.admin.styleeditor/"
    533                     MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('edit layout template', 'midcom.admin.styleeditor'), 
     540                    MIDCOM_TOOLBAR_URL => $styleeditor_url
     541                    MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('edit layout template', 'midgard.admin.asgard'), 
    534542                    MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/text-x-generic-template.png', 
    535543                    MIDCOM_TOOLBAR_ACCESSKEY => 't', 
  • branches/ragnaroek/midcom/midgard.admin.asgard/handler/object/manage.php

    r25057 r25305  
    123123        $this->_l10n =& $this->_request_data['l10n']; 
    124124        midgard_admin_asgard_plugin::get_default_mode($this->_request_data); 
     125 
     126        // Accordion is needed for per-type help when available 
     127        $_MIDCOM->add_jsfile(MIDCOM_JQUERY_UI_URL . '/ui/ui.core.js'); 
     128        $_MIDCOM->add_jsfile(MIDCOM_JQUERY_UI_URL . '/ui/minified/ui.accordion.min.js'); 
    125129    } 
    126130 
  • branches/ragnaroek/midcom/midgard.admin.asgard/locale/default.en.txt

    r25280 r25305  
    212212---STRINGEND 
    213213 
     214---STRING copy default value 
     215Copy from the default 
     216---STRINGEND 
     217 
    214218---STRING copy metadata 
    215219Copy metadata 
     
    252256---STRINGEND 
    253257 
     258---STRING creating new style element 
     259Elements you can use in this Style 
     260---STRINGEND 
     261 
    254262---STRING date 
    255263Date 
     
    308316---STRINGEND 
    309317 
     318---STRING edit layout template 
     319Edit layout template 
     320---STRINGEND 
     321 
    310322---STRING edit text file 
    311323Edit text file 
     
    316328---STRINGEND 
    317329 
     330---STRING element %s from component %s 
     331Element "%s" used in %s 
     332---STRINGEND 
     333 
     334---STRING element defaults 
     335Default contents of the element 
     336---STRINGEND 
     337 
    318338---STRING enable breaking of the editing lock 
    319339Enable breaking of the editing lock 
  • branches/ragnaroek/midcom/midgard.admin.asgard/static/screen.css

    r24593 r25305  
    5454  -moz-border-radius: 6px; 
    5555  -webkit-border-radius: 6px; 
     56  border-radius: 6px; 
    5657  padding-top: 16px; 
    5758  overflow: auto; 
     
    890891    display: none; 
    891892} 
     893 
     894/* Object editing help */ 
     895#content div.midgard_admin_asgard_objecthelper_help 
     896{ 
     897    background-color: #888a85; 
     898    background-color: #d3d7cf; 
     899    -moz-border-radius: 6px; 
     900    -webkit-border-radius: 6px; 
     901    border-radius: 6px; 
     902    padding: 12px; 
     903    margin-bottom: 12px; 
     904} 
     905#content div.midgard_admin_asgard_objecthelper_help h3 
     906{ 
     907    margin: 0px; 
     908    padding: 0px; 
     909} 
     910#content div.midgard_admin_asgard_objecthelper_help h3 a 
     911{ 
     912    color: #000000; 
     913} 
     914#content div.ui-accordion h3 a 
     915{ 
     916    background-image: url('../stock-icons/16x16/list-add.png'); 
     917    background-position: left; 
     918    background-repeat: no-repeat; 
     919    padding-left: 20px; 
     920} 
     921#content div.ui-accordion h3.selected a 
     922{ 
     923    background-image: url('../stock-icons/16x16/list-remove.png'); 
     924} 
     925#content div.midgard_admin_asgard_objecthelper_help > div 
     926{ 
     927    margin-top: 6px; 
     928    background-color: #babdb6; 
     929    -moz-border-radius: 6px; 
     930    -webkit-border-radius: 6px; 
     931    border-radius: 6px; 
     932    padding: 6px; 
     933} 
     934 
     935#content div.midgard_admin_asgard_objecthelper_help div ul li.component 
     936{ 
     937    font-weight: bold;    
     938    margin-bottom: 1em; 
     939} 
     940#content div.midgard_admin_asgard_objecthelper_help div ul li.component:last-child 
     941 
     942    margin-bottom: 0px; 
     943} 
     944 
     945#content div.midgard_admin_asgard_objecthelper_help div ul, 
     946#content div.midgard_admin_asgard_objecthelper_help div ul li.component ul 
     947{ 
     948     list-style: none; 
     949     margin-left: 0px; 
     950     padding-left: 0px; 
     951     margin-top: 0px; 
     952     margin-bottom: 0px; 
     953} 
     954#content div.midgard_admin_asgard_objecthelper_help div ul li.component ul li 
     955{ 
     956     display: inline; 
     957     font-weight: normal; 
     958     margin-left: 0px; 
     959     padding-left: 0px; 
     960     margin-right: 1em; 
     961} 
     962#content div.midgard_admin_asgard_objecthelper_help div ul li.component ul li a 
     963{ 
     964    color: #000000; 
     965} 
     966 
     967#content div.midgard_admin_asgard_objecthelper_help label 
     968{ 
     969    font-weight: bold; 
     970    display: block; 
     971} 
     972#content div.midgard_admin_asgard_objecthelper_help textarea 
     973{ 
     974    width: 90%; 
     975    height: 16em; 
     976    border: none; 
     977    background-color: #d3d7cf; 
     978    color: #555753; 
     979} 
     980#content div.midgard_admin_asgard_objecthelper_help button.copy 
     981{ 
     982    background-image: url('../stock-icons/16x16/editcopy.png'); 
     983    background-position: left; 
     984    background-repeat: no-repeat; 
     985    padding-left: 20px; 
     986} 
  • branches/ragnaroek/midcom/midgard.admin.asgard/style/midgard_admin_asgard_object_create.php

    r23023 r25305  
     1<?php 
     2midgard_admin_asgard_objecthelper::get_help($data); 
     3?> 
    14<div class="object_edit"> 
    25   <?php $data['controller']->display_form(); ?> 
  • branches/ragnaroek/midcom/midgard.admin.asgard/style/midgard_admin_asgard_object_edit.php

    r23023 r25305  
     1<?php 
     2midgard_admin_asgard_objecthelper::get_help($data); 
     3?> 
    14<script type="text/javascript"> 
    25     jQuery(document).ready(function() { 
  • branches/ragnaroek/midcom/midgard.admin.asgard/style/midgard_admin_asgard_object_view.php

    r23023 r25305  
     1<?php 
     2midgard_admin_asgard_objecthelper::get_help($data); 
     3?> 
    14<div class="object_view"> 
    25    <?php $data['datamanager']->display_view(); ?>