Changeset 11341

Show
Ignore:
Timestamp:
07/24/07 15:16:28 (1 year ago)
Author:
adrenalin
Message:

Ported midcom.admin.styleeditor to midgard.admin.asgard plugin, closes #37

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.admin.styleeditor/handler/create.php

    r5811 r11341  
    6464        $tmp[] = Array 
    6565        ( 
    66             MIDCOM_NAV_URL => "__mfa/styleeditor/", 
     66            MIDCOM_NAV_URL => "__mfa/asgard_midcom.admin.styleeditor/", 
    6767            MIDCOM_NAV_NAME => $_MIDCOM->i18n->get_string('edit layout template', 'midcom.admin.styleeditor'), 
    6868        ); 
     
    7171        ( 
    7272            MIDCOM_NAV_URL => "", 
    73             MIDCOM_NAV_NAME => $_MIDCOM->i18n->get_string('create new element', 'midcom.admin.styleeditor'), 
     73            MIDCOM_NAV_NAME => $_MIDCOM->i18n->get_string('create a new element', 'midcom.admin.styleeditor'), 
    7474        ); 
    7575 
     
    7979    function _process_form() 
    8080    { 
    81         $message = ''; 
    82      
    83                 if (array_key_exists('midcom_admin_styleeditor_style_name', $_POST)) 
    84         { 
    85                 if ($_POST['midcom_admin_styleeditor_style_name'] != null || !empty($_FILES)) 
    86                 { 
    87                         if (!array_key_exists($_POST['midcom_admin_styleeditor_style_name'],$this->_style_elements['midcom']))                                                                                      
    88                         {                                                                                                                                  
    89                         $this->_request_data['style']->require_do('midgard:create'); 
    90                  
    91                         // We don't have element yet, create 
    92                         $this->_request_data['style_element_object'] = new midcom_db_element(); 
    93                         $this->_request_data['style_element_object']->style = $this->_request_data['style']->id; 
    94                          
    95                  
    96                         // do we have file uploaded? 
    97                         // TODO: file should be text/plain only 
    98                  
    99                         if ($_FILES['midcom_admin_styleeditor_style_file']['tmp_name']) 
    100                         { 
    101                                 $value = file_get_contents($_FILES['midcom_admin_styleeditor_style_file']['tmp_name']); 
    102                                 $name = midcom_generate_urlname_from_string(basename($_FILES['midcom_admin_styleeditor_style_file']['name'],'php')); 
    103                         } 
    104                         else 
    105                         { 
    106                                 $value = $_POST['midcom_admin_styleeditor_style_edit']; 
    107                                 $name = $_POST['midcom_admin_styleeditor_style_name']; 
    108                         } 
    109                         $this->_request_data['style_element_object']->value = $value; 
    110                         $this->_request_data['style_element_object']->name = $name; 
    111                          
    112                         if (!$this->_request_data['style_element_object']->create()) 
    113                         { 
    114                         $message = sprintf($_MIDCOM->i18n->get_string('failed to create a new element: %s'), mgd_errstr()); 
    115                         } 
    116                  
    117                         mgd_cache_invalidate(); 
    118                         $_MIDCOM->relocate("__mfa/styleeditor/edit/".$this->_request_data['style_element_object']->name."/"); 
    119                     } 
    120                 else 
    121                     { 
    122                         $message = sprintf($_MIDCOM->i18n->get_string('element %s exists', 'midcom.admin.styleeditor'),$_POST['midcom_admin_styleeditor_style_name']); 
    123                 } 
     81        $message = ''; 
     82     
     83        if (array_key_exists('midcom_admin_styleeditor_style_name', $_POST)) 
     84        { 
     85            if ($_POST['midcom_admin_styleeditor_style_name'] != null || !empty($_FILES)) 
     86            { 
     87                if (!array_key_exists($_POST['midcom_admin_styleeditor_style_name'],$this->_style_elements['midcom']))                                                                                      
     88                {                                                                                                                                  
     89                    $this->_request_data['style']->require_do('midgard:create'); 
     90                 
     91                    // We don't have element yet, create 
     92                    $this->_request_data['style_element_object'] = new midcom_db_element(); 
     93                    $this->_request_data['style_element_object']->style = $this->_request_data['style']->id; 
     94                     
     95                 
     96                    // do we have file uploaded? 
     97                    // TODO: file should be text/plain only 
     98                 
     99                    if ($_FILES['midcom_admin_styleeditor_style_file']['tmp_name']) 
     100                    { 
     101                        $value = file_get_contents($_FILES['midcom_admin_styleeditor_style_file']['tmp_name']); 
     102                        $name = midcom_generate_urlname_from_string(basename($_FILES['midcom_admin_styleeditor_style_file']['name'],'php')); 
     103                    } 
     104                    else 
     105                    { 
     106                        $value = $_POST['midcom_admin_styleeditor_style_edit']; 
     107                        $name = $_POST['midcom_admin_styleeditor_style_name']; 
     108                    } 
     109                    $this->_request_data['style_element_object']->value = $value; 
     110                    $this->_request_data['style_element_object']->name = $name; 
     111                     
     112                    if (!$this->_request_data['style_element_object']->create()) 
     113                    { 
     114                        $message = sprintf($_MIDCOM->i18n->get_string('failed to create a new element: %s'), mgd_errstr()); 
     115                    } 
     116                 
     117                    // Show the user interface message 
     118                    $_MIDCOM->uimessages->add($_MIDCOM->i18n->get_string('midcom.admin.styleeditor', 'midcom.admin.styleeditor'), sprintf($_MIDCOM->i18n->get_string('style element %s created', 'midcom.admin.styleeditor'), "<({$this->_style_element})>")); 
     119                     
     120                    mgd_cache_invalidate(); 
     121                    $_MIDCOM->relocate("__mfa/asgard_midcom.admin.styleeditor/edit/".$this->_request_data['style_element_object']->name."/"); 
     122                } 
     123                else 
     124                { 
     125                    $message = sprintf($_MIDCOM->i18n->get_string('element %s exists', 'midcom.admin.styleeditor'),$_POST['midcom_admin_styleeditor_style_name']); 
     126                } 
    124127            } 
    125128            else 
    126                { 
    127                $message = $_MIDCOM->i18n->get_string('element name required', 'midcom.admin.styleeditor'); 
    128                
     129            { 
     130                $message = $_MIDCOM->i18n->get_string('element name required', 'midcom.admin.styleeditor'); 
     131           
    129132        } 
    130133         
    131134        $this->_request_data['message'] = $message; 
    132135 
     136        // Show the user interface message 
     137        if ($message) 
     138        { 
     139            $_MIDCOM->uimessages->add($_MIDCOM->i18n->get_string('midcom.admin.styleeditor', 'midcom.admin.styleeditor'), $message); 
     140        } 
    133141    } 
    134142     
     
    171179 
    172180        // Ensure we get the correct styles 
     181        $_MIDCOM->style->prepend_component_styledir('midgard.admin.asgard'); 
    173182        $_MIDCOM->style->prepend_component_styledir('midcom.admin.styleeditor'); 
    174183         
     
    177186        // Skip the page styles 
    178187        $_MIDCOM->skip_page_style = true; 
     188         
     189        // Set the Asgard toolbar 
     190        $data['asgard_toolbar'] = new midcom_helper_toolbar(); 
     191         
     192        $data['asgard_toolbar']->add_item 
     193        ( 
     194            array 
     195            ( 
     196                MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.admin.styleeditor/create/", 
     197                MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('create a new element', 'midcom.admin.styleeditor'), 
     198                MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/text-x-generic-template.png', 
     199            ) 
     200        );         
     201        $data['asgard_toolbar']->add_item 
     202        ( 
     203            array 
     204            ( 
     205                MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.admin.styleeditor/files/", 
     206                MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('style attachments', 'midcom.admin.styleeditor'), 
     207                MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/attach.png', 
     208            ) 
     209        ); 
     210         
     211        // Add the page title 
     212        $data['view_title'] = $_MIDCOM->i18n->get_string('create a new element', 'midcom.admin.styleeditor'); 
    179213         
    180214        return true; 
     
    190224    function _show_create($handler_id, &$data) 
    191225    { 
    192         midcom_show_style('midcom-admin-styleeditor-style-page-header'); 
     226        midcom_show_style('midgard_admin_asgard_header'); 
     227        midcom_show_style('midgard_admin_asgard_middle'); 
    193228        midcom_show_style('midcom-admin-styleeditor-style-create'); 
    194         midcom_show_style('midcom-admin-styleeditor-style-page-footer'); 
     229        midcom_show_style('midgard_admin_asgard_footer');     
    195230    } 
    196231} 
  • trunk/midcom/midcom.admin.styleeditor/handler/edit.php

    r11100 r11341  
    5858    } 
    5959     
     60    /** 
     61     * Load the default style element 
     62     *  
     63     * @access private 
     64     */ 
    6065    function _load_default_elements() 
    6166    { 
     67        if (!isset($this->_style_elements[$this->_component][$this->_request_data['style_element']])) 
     68        { 
     69            $this->_request_data['style_element_default_contents'] = ''; 
     70            return; 
     71        } 
     72         
    6273        $this->_request_data['style_element_default_path'] = $this->_style_elements[$this->_component][$this->_request_data['style_element']]; 
    6374         
     
    7889        $tmp[] = Array 
    7990        ( 
    80             MIDCOM_NAV_URL => "__mfa/styleeditor/", 
     91            MIDCOM_NAV_URL => "__mfa/asgard_midcom.admin.styleeditor/", 
    8192            MIDCOM_NAV_NAME => $_MIDCOM->i18n->get_string('edit layout template', 'midcom.admin.styleeditor'), 
    8293        ); 
    8394        $tmp[] = Array 
    8495        ( 
    85             MIDCOM_NAV_URL => "__mfa/styleeditor/edit/{$this->_request_data['style_element']}/", 
     96            MIDCOM_NAV_URL => "__mfa/asgard_midcom.admin.styleeditor/edit/{$this->_request_data['style_element']}/", 
    8697            MIDCOM_NAV_NAME => sprintf($_MIDCOM->i18n->get_string('edit element %s', 'midcom.admin.styleeditor'), "<({$this->_request_data['style_element']})>"), 
    8798        ); 
     
    106117            mgd_cache_invalidate();             
    107118             
     119                // Show the user interface message 
     120                $_MIDCOM->uimessages->add($_MIDCOM->i18n->get_string('midcom.admin.styleeditor', 'midcom.admin.styleeditor'), sprintf($_MIDCOM->i18n->get_string('style element %s deleted', 'midcom.admin.styleeditor'), "<({$this->_style_element})>")); 
     121                 
    108122            unset($this->_request_data['style_element_object']); 
    109123 
     
    141155                mgd_cache_invalidate(); 
    142156                 
     157                // Show the user interface message 
     158                $_MIDCOM->uimessages->add($_MIDCOM->i18n->get_string('midcom.admin.styleeditor', 'midcom.admin.styleeditor'), sprintf($_MIDCOM->i18n->get_string('style element %s created', 'midcom.admin.styleeditor'), "<({$this->_style_element})>")); 
     159                 
    143160                $_MIDCOM->bind_view_to_object($this->_request_data['style_element_object']); 
    144161            } 
     
    153170                    $_MIDCOM->generate_error(MIDCOM_ERRCRIT, 'Failed to update the element, cannot continue. Last Midgard error was: '. mgd_errstr()); 
    154171                } 
     172                 
     173                // Show the user interface message 
     174                $_MIDCOM->uimessages->add($_MIDCOM->i18n->get_string('midcom.admin.styleeditor', 'midcom.admin.styleeditor'), sprintf($_MIDCOM->i18n->get_string('style element %s updated', 'midcom.admin.styleeditor'), "<({$this->_style_element})>")); 
    155175                 
    156176                mgd_cache_invalidate(); 
     
    176196            array 
    177197            ( 
    178                 MIDCOM_TOOLBAR_URL => "__mfa/styleeditor/create/", 
    179                 MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('create new element', 'midcom.admin.styleeditor'), 
     198                MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.admin.styleeditor/create/", 
     199                MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('create a new element', 'midcom.admin.styleeditor'), 
    180200                MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/text-x-generic-template.png', 
    181201            ) 
     
    185205            array 
    186206            ( 
    187                 MIDCOM_TOOLBAR_URL => "__mfa/styleeditor/files/", 
     207                MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.admin.styleeditor/files/", 
    188208                MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('style attachments', 'midcom.admin.styleeditor'), 
    189209                MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/attach.png', 
    190210            ) 
    191211        ); 
    192  
    193  
    194              
     212         
    195213        $data['style_element'] = $args[0]; 
     214        $this->_style_element = $args[0]; 
    196215         
    197216        $style_information = $_MIDCOM->style->get_style_elements_and_nodes($this->_topic->style); 
     
    224243            } 
    225244        } 
     245         
     246        /* 
     247        // Deprecated. Style editor has to support also custom names 
    226248        if (!$style_element_found) 
    227249        { 
     
    229251            return false; 
    230252        } 
     253        */ 
    231254         
    232255        // Load the style object and check ACL 
     
    249272         
    250273        // Ensure we get the correct styles 
     274        $_MIDCOM->style->prepend_component_styledir('midgard.admin.asgard'); 
    251275        $_MIDCOM->style->prepend_component_styledir('midcom.admin.styleeditor'); 
    252276         
     
    255279        // Skip the page styles 
    256280        $_MIDCOM->skip_page_style = true; 
     281         
     282        // Set the Asgard toolbar 
     283        $data['asgard_toolbar'] = new midcom_helper_toolbar(); 
     284         
     285        $data['asgard_toolbar']->add_item 
     286        ( 
     287            array 
     288            ( 
     289                MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.admin.styleeditor/create/", 
     290                MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('create a new element', 'midcom.admin.styleeditor'), 
     291                MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/text-x-generic-template.png', 
     292            ) 
     293        );         
     294        $data['asgard_toolbar']->add_item 
     295        ( 
     296            array 
     297            ( 
     298                MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.admin.styleeditor/files/", 
     299                MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('style attachments', 'midcom.admin.styleeditor'), 
     300                MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/attach.png', 
     301            ) 
     302        ); 
     303         
     304        // Add the page title 
     305        $data['view_title'] = sprintf($_MIDCOM->i18n->get_string('edit element %s', 'midcom.admin.styleeditor'), "<({$data['style_element']})>"); 
    257306         
    258307        return true; 
     
    268317    function _show_edit($handler_id, &$data) 
    269318    { 
    270         midcom_show_style('midcom-admin-styleeditor-style-page-header'); 
     319        midcom_show_style('midgard_admin_asgard_header'); 
     320        midcom_show_style('midgard_admin_asgard_middle'); 
    271321        midcom_show_style('midcom-admin-styleeditor-style-edit'); 
    272         midcom_show_style('midcom-admin-styleeditor-style-page-footer'); 
     322        midcom_show_style('midgard_admin_asgard_footer');     
    273323    } 
    274324} 
  • trunk/midcom/midcom.admin.styleeditor/handler/file.php

    r5466 r11341  
    128128        $tmp[] = Array 
    129129        ( 
    130             MIDCOM_NAV_URL => '__mfa/styleeditor/', 
     130            MIDCOM_NAV_URL => '__mfa/asgard_midcom.admin.styleeditor/', 
    131131            MIDCOM_NAV_NAME => $_MIDCOM->i18n->get_string('edit layout template', 'midcom.admin.styleeditor'), 
    132132        ); 
     
    135135        $tmp[] = Array 
    136136        ( 
    137             MIDCOM_NAV_URL => "__mfa/styleeditor/files/", 
     137            MIDCOM_NAV_URL => "__mfa/asgard_midcom.admin.styleeditor/files/", 
    138138            MIDCOM_NAV_NAME => $_MIDCOM->i18n->get_string('style attachments', 'midcom.admin.styleeditor'), 
    139139        ); 
     
    144144                $tmp[] = Array 
    145145                ( 
    146                     MIDCOM_NAV_URL => "__mfa/styleeditor/files/{$this->_request_data['filename']}/", 
     146                    MIDCOM_NAV_URL => "__mfa/asgard_midcom.admin.styleeditor/files/{$this->_request_data['filename']}/", 
    147147                    MIDCOM_NAV_NAME => sprintf($_MIDCOM->i18n->get_string('edit file %s', 'midcom.admin.styleeditor'), $this->_request_data['filename']), 
    148148                ); 
     
    340340        else 
    341341        { 
    342             $_MIDCOM->relocate("__mfa/styleeditor/files/{$filename}"); 
     342            $_MIDCOM->relocate("__mfa/asgard_midcom.admin.styleeditor/files/{$filename}"); 
    343343        } 
    344344         
    345345        // Ensure we get the correct styles 
     346        $_MIDCOM->style->prepend_component_styledir('midgard.admin.asgard'); 
    346347        $_MIDCOM->style->prepend_component_styledir('midcom.admin.styleeditor'); 
    347348         
     
    352353        $_MIDCOM->skip_page_style = true; 
    353354         
     355        // Set the Asgard toolbar 
     356        $data['asgard_toolbar'] = new midcom_helper_toolbar(); 
     357         
     358        $data['asgard_toolbar']->add_item 
     359        ( 
     360            array 
     361            ( 
     362                MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.admin.styleeditor/create/", 
     363                MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('create a new element', 'midcom.admin.styleeditor'), 
     364                MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/text-x-generic-template.png', 
     365            ) 
     366        );         
     367        $data['asgard_toolbar']->add_item 
     368        ( 
     369            array 
     370            ( 
     371                MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.admin.styleeditor/files/", 
     372                MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('style attachments', 'midcom.admin.styleeditor'), 
     373                MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/attach.png', 
     374            ) 
     375        ); 
     376         
     377        // Add the page title 
     378        $data['view_title'] = $_MIDCOM->i18n->get_string('style attachments', 'midcom.admin.styleeditor'); 
     379         
    354380        return true; 
    355381    } 
     
    364390    function _show_new($handler_id, &$data) 
    365391    { 
    366         midcom_show_style('midcom-admin-styleeditor-style-page-header'); 
     392        midcom_show_style('midgard_admin_asgard_header'); 
     393        midcom_show_style('midgard_admin_asgard_middle'); 
    367394         
    368395        $data['files'] =& $this->_files; 
     
    372399        midcom_show_style('midcom-admin-styleeditor-files-new'); 
    373400        midcom_show_style('midcom-admin-styleeditor-files-footer'); 
    374         midcom_show_style('midcom-admin-styleeditor-style-page-footer'); 
     401        midcom_show_style('midgard_admin_asgard_footer'); 
    375402    } 
    376403 
     
    412439            if ($filename != $data['filename']) 
    413440            { 
    414                 $_MIDCOM->relocate("__mfa/styleeditor/files/{$filename}"); 
     441                $_MIDCOM->relocate("__mfa/asgard_midcom.admin.styleeditor/files/{$filename}"); 
    415442            } 
    416443        } 
    417444         
    418445        // Ensure we get the correct styles 
     446        $_MIDCOM->style->prepend_component_styledir('midgard.admin.asgard'); 
    419447        $_MIDCOM->style->prepend_component_styledir('midcom.admin.styleeditor'); 
    420448         
     
    425453        $_MIDCOM->skip_page_style = true; 
    426454         
     455        // Add the page title 
     456        $data['view_title'] = sprintf($_MIDCOM->i18n->get_string('edit file %s', 'midcom.admin.styleeditor'), "'{$args[0]}'"); 
     457         
     458        // Set the Asgard toolbar 
     459        $data['asgard_toolbar'] = new midcom_helper_toolbar(); 
     460         
     461        $data['asgard_toolbar']->add_item 
     462        ( 
     463            array 
     464            ( 
     465                MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.admin.styleeditor/create/", 
     466                MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('create a new element', 'midcom.admin.styleeditor'), 
     467                MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/text-x-generic-template.png', 
     468            ) 
     469        );         
     470        $data['asgard_toolbar']->add_item 
     471        ( 
     472            array 
     473            ( 
     474                MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.admin.styleeditor/files/", 
     475                MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('style attachments', 'midcom.admin.styleeditor'), 
     476                MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/attach.png', 
     477            ) 
     478        ); 
     479         
    427480        return true; 
    428481    } 
     
    437490    function _show_edit($handler_id, &$data) 
    438491    { 
    439         midcom_show_style('midcom-admin-styleeditor-style-page-header'); 
     492        midcom_show_style('midgard_admin_asgard_header'); 
     493        midcom_show_style('midgard_admin_asgard_middle'); 
    440494         
    441495        $data['files'] =& $this->_files; 
     
    446500        midcom_show_style('midcom-admin-styleeditor-files-file'); 
    447501        midcom_show_style('midcom-admin-styleeditor-files-footer'); 
    448         midcom_show_style('midcom-admin-styleeditor-style-page-footer'); 
     502        midcom_show_style('midgard_admin_asgard_footer');     
    449503    } 
    450504} 
  • trunk/midcom/midcom.admin.styleeditor/handler/list.php

    r11335 r11341  
    9191        $tmp[] = Array 
    9292        ( 
    93             MIDCOM_NAV_URL => "__mfa/styleeditor/", 
     93            MIDCOM_NAV_URL => "__mfa/asgard_midcom.admin.styleeditor/", 
    9494            MIDCOM_NAV_NAME => $_MIDCOM->i18n->get_string('edit layout template', 'midcom.admin.styleeditor'), 
    9595        ); 
     
    119119            array 
    120120            ( 
    121                 MIDCOM_TOOLBAR_URL => "__mfa/styleeditor/create/", 
    122                 MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('create new element', 'midcom.admin.styleeditor'), 
     121                MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.admin.styleeditor/create/", 
     122                MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('create a new element', 'midcom.admin.styleeditor'), 
    123123                MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/text-x-generic-template.png', 
    124124            ) 
     
    128128            array 
    129129            ( 
    130                 MIDCOM_TOOLBAR_URL => "__mfa/styleeditor/files/", 
     130                MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.admin.styleeditor/files/", 
    131131                MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('style attachments', 'midcom.admin.styleeditor'), 
    132132                MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/attach.png', 
     
    160160 
    161161        // Disable the "Edit template" button when we're at its view 
    162         $this->_view_toolbar->hide_item("__mfa/styleeditor/"); 
     162        $this->_view_toolbar->hide_item("__mfa/asgard_midcom.admin.styleeditor/"); 
    163163         
    164164        // Ensure we get the correct styles 
     
    261261        midcom_show_style('midcom-admin-styleeditor-stylelist-footer'); 
    262262        midcom_show_style('midgard_admin_asgard_footer');     
    263  
    264263    } 
    265264} 
  • trunk/midcom/midcom.admin.styleeditor/locale/default.en.txt

    r11197 r11341  
    2424---STRINGEND 
    2525 
    26 ---STRING create new element 
    27 Create new element 
     26---STRING create a new element 
     27Create a new element 
    2828---STRINGEND 
    2929 
     
    4949 
    5050---STRING element from file 
    51 Upload element 
     51Upload an element 
    5252---STRINGEND 
    5353 
     
    116116---STRINGEND 
    117117 
     118---STRING local element 
     119Local element 
     120---STRINGEND 
     121 
     122---STRING style element %s updated 
     123Style element %s updated 
     124---STRINGEND 
     125 
     126---STRING style element %s created 
     127Style element %s created 
     128---STRINGEND 
  • trunk/midcom/midcom.admin.styleeditor/static/style-editor.css

    r5778 r11341  
    55} 
    66 
    7 body.style-editor #container div.breadcrumb 
     7#container div.breadcrumb 
    88{ 
    99    font-size: 80%; 
     
    1111} 
    1212 
    13 body.style-editor form.midcom_admin_folder_styleeditor textarea.element 
     13form.midcom_admin_folder_styleeditor textarea.element 
    1414{ 
    1515    width: 90%; 
     
    1717} 
    1818 
    19 body.style-editor form.midcom_admin_folder_styleeditor pre 
     19form.midcom_admin_folder_styleeditor pre 
    2020{ 
    2121    width: 90%; 
     
    2323} 
    2424 
    25 body.style-editor fieldset legend 
    26 { 
    27     font-weight: bold; 
    28 } 
    29  
    30 body.style-editor fieldset.component_default legend 
     25fieldset legend 
     26{ 
     27    font-weight: bold; 
     28} 
     29 
     30fieldset.component_default legend 
    3131{ 
    3232    background-repeat: no-repeat; 
     
    3737} 
    3838 
    39 body.style-editor fieldset.component_default div.content span.copy 
     39fieldset.component_default div.content span.copy 
    4040{ 
    4141    font-weight: bold; 
     
    4444} 
    4545 
    46 body.style-editor fieldset button, 
    47 body.style-editor form input.save, 
    48 body.style-editor form input.delete 
     46fieldset button, 
     47form input.save, 
     48form input.delete 
    4949{ 
    5050    background-repeat: no-repeat; 
     
    6363} 
    6464 
    65 body.style-editor fieldset button:hover, 
    66 body.style-editor form input.save:hover, 
    67 body.style-editor form input.delete:hover 
     65fieldset button:hover, 
     66form input.save:hover, 
     67form input.delete:hover 
    6868{ 
    6969    background-color: #dddddd; 
    7070} 
    7171 
    72 body.style-editor fieldset button.copy 
     72fieldset button.copy 
    7373{ 
    7474    background-image: url('../stock-icons/16x16/editcopy.png'); 
    7575} 
    7676 
    77 body.style-editor form input.save 
     77form input.save 
    7878{ 
    7979    background-image: url('../stock-icons/16x16/save.png'); 
    8080} 
    8181 
    82 body.style-editor form input.delete 
     82form input.delete 
    8383{ 
    8484    background-image: url('../stock-icons/16x16/trash.png'); 
    8585} 
    8686 
    87 body.style-editor #container a:link, 
    88 body.style-editor #container a:visited 
     87#container a:link, 
     88#container a:visited 
    8989{ 
    9090    text-decoration: none; 
     
    9393} 
    9494 
    95 body.style-editor #container a:hover, 
    96 body.style-editor #container a:visited:hover 
     95#container a:hover, 
     96#container a:visited:hover 
    9797{ 
    9898    text-decoration: underline; 
     
    140140 
    141141/** File management styles */ 
    142 body.style-editor div.file-manager div.filelist 
     142div.file-manager 
     143
     144    margin-top: 1em; 
     145
     146 
     147div.file-manager div.filelist 
    143148{ 
    144149    float: left; 
     
    149154    padding: 2%; 
    150155} 
    151 body.style-editor div.file-manager div.filelist ul 
     156div.file-manager div.filelist ul 
    152157{ 
    153158    margin: 0px; 
     
    155160    white-space: nowrap; 
    156161} 
    157 body.style-editor div.file-manager div.filelist ul li a 
     162div.file-manager div.filelist ul li a 
    158163{ 
    159164    display: block; 
     
    162167    margin-bottom: 4px; 
    163168} 
    164 body.style-editor div.file-manager div.filelist ul li.selected a,  
    165 body.style-editor div.file-manager div.filelist ul li a:hover 
     169div.file-manager div.filelist ul li.selected a,  
     170div.file-manager div.filelist ul li a:hover 
    166171{ 
    167172    background-color: #8f5902; 
    168173} 
    169 body.style-editor div.file-manager div.filelist ul li a img 
     174div.file-manager div.filelist ul li a img 
    170175{ 
    171176    border: none; 
    172177    vertical-align: middle; 
    173178} 
    174 body.style-editor div.file-manager div.main 
    175 
    176     float: left; 
    177     width: 68%; 
    178     margin-left: 2%; 
    179 
    180 body.style-editor div.file-manager div.main h1 
     179div.file-manager div.main 
     180
     181    margin-left: 32%; 
     182
     183div.file-manager div.main h1 
    181184{ 
    182185    margin-top: 0px; 
    183186} 
    184 body.style-editor div.file-manager div.main form 
     187div.file-manager div.main form 
    185188{ 
    186189    border: 1px solid #ce5c00; 
     
    188191    margin-bottom: 1em; 
    189192} 
    190 body.style-editor div.file-manager div.main form hr 
     193div.file-manager div.main form hr 
    191194{ 
    192195    margin-top: 1em; 
     
    197200    background-color: #ce5c00; 
    198201} 
    199 body.style-editor fieldset 
     202fieldset 
    200203{ 
    201204    border: none; 
    202205    margin-bottom: 6px; 
    203206} 
    204 body.style-editor fieldset legend 
     207fieldset legend 
    205208{ 
    206209    margin-left: 0px; 
     
    208211    text-transform: uppercase; 
    209212} 
    210 body.style-editor div.file-manager div.main form label span 
     213div.file-manager div.main form label span 
    211214{ 
    212215    margin-top: 6px; 
     
    214217    font-weight: bold; 
    215218} 
    216 body.style-editor div.file-manager div.main form input,  
    217 body.style-editor div.file-manager div.main form textarea, 
    218 body.style-editor div.file-manager div.main form select 
     219div.file-manager div.main form input,  
     220div.file-manager div.main form textarea, 
     221div.file-manager div.main form select 
    219222{ 
    220223    display: block; 
    221224    margin-left: 2%; 
    222225} 
    223 body.style-editor form input.text, 
    224 body.style-editor form textarea 
     226form input.text, 
     227form textarea 
    225228{ 
    226229    width: 90%; 
    227230} 
    228231 
    229 body.style-editor div.file-manager div.main form.urlform a img 
     232div.file-manager div.main form.urlform a img 
    230233{ 
    231234    border: none; 
     
    280283#midcom_admin_styleeditor_style div.message 
    281284{ 
    282        color: red; 
    283 } 
     285  color: red; 
     286} 
  • trunk/midcom/midcom.admin.styleeditor/style/midcom-admin-styleeditor-files-file.php

    r5458 r11341  
    5757         
    5858        <label><span><?php echo $_MIDCOM->i18n->get_string('url', 'midcom.admin.styleeditor'); ?></span> 
    59             <input class="text" type="text" value="&(file_url);" /> 
     59            <input class="text" type="text" value="&(file_url);" readonly="readonly" /> 
    6060        </label> 
    6161    </fieldset> 
  • trunk/midcom/midcom.admin.styleeditor/style/midcom-admin-styleeditor-style-create.php

    r5812 r11341  
    1111} 
    1212?> 
    13 <h1><?php echo $_MIDCOM->i18n->get_string('create new element', 'midcom.admin.styleeditor'); ?></h1> 
     13<h1><?php echo $_MIDCOM->i18n->get_string('create a new element', 'midcom.admin.styleeditor'); ?></h1> 
    1414<div id="midcom_admin_styleeditor_style"> 
    1515        <div class="message">&(data['message']);</div>