Changeset 5778
- Timestamp:
- 04/21/07 03:04:17 (2 years ago)
- Files:
-
- trunk/src/midcom.admin.styleeditor/handler/create.php (added)
- trunk/src/midcom.admin.styleeditor/handler/edit.php (modified) (3 diffs)
- trunk/src/midcom.admin.styleeditor/handler/list.php (modified) (1 diff)
- trunk/src/midcom.admin.styleeditor/locale/default.en.txt (modified) (5 diffs)
- trunk/src/midcom.admin.styleeditor/static/style-editor.css (modified) (1 diff)
- trunk/src/midcom.admin.styleeditor/style/midcom-admin-styleeditor-style-create.php (added)
- trunk/src/midcom.admin.styleeditor/style/midcom-admin-styleeditor-style-edit.php (modified) (1 diff)
- trunk/src/midcom.admin.styleeditor/viewer.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/midcom.admin.styleeditor/handler/edit.php
r5620 r5778 106 106 107 107 unset($this->_request_data['style_element_object']); 108 108 109 } 109 110 elseif (array_key_exists('midcom_admin_styleeditor_style_edit', $_POST)) 110 111 { 112 // do we have file uploaded? 113 // TODO: file should be text/plain only 114 115 if ($_FILES['midcom_admin_styleeditor_style_file']) 116 { 117 $value = file_get_contents($_FILES['midcom_admin_styleeditor_style_file']['tmp_name']); 118 } 119 else 120 { 121 $value = $_POST['midcom_admin_styleeditor_style_edit']; 122 } 123 111 124 // User is saving, do it 112 125 if (!isset($this->_request_data['style_element_object'])) … … 118 131 $this->_request_data['style_element_object']->style = $this->_request_data['style']->id; 119 132 $this->_request_data['style_element_object']->name = $this->_request_data['style_element']; 120 $this->_request_data['style_element_object']->value = $ _POST['midcom_admin_styleeditor_style_edit'];133 $this->_request_data['style_element_object']->value = $value; 121 134 122 135 if (!$this->_request_data['style_element_object']->create()) … … 133 146 $this->_request_data['style_element_object']->require_do('midgard:update'); 134 147 135 $this->_request_data['style_element_object']->value = $ _POST['midcom_admin_styleeditor_style_edit'];148 $this->_request_data['style_element_object']->value = $value; 136 149 137 150 if (!$this->_request_data['style_element_object']->update()) trunk/src/midcom.admin.styleeditor/handler/list.php
r5461 r5778 119 119 ) 120 120 ); 121 121 122 $this->_view_toolbar->add_item 123 ( 124 array 125 ( 126 MIDCOM_TOOLBAR_URL => "__mfa/styleeditor/create/", 127 MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('new style element', 'midcom.admin.styleeditor'), 128 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/text-x-generic-template.png', 129 ) 130 ); 122 131 // Set the variables 123 132 $this->_component = $this->_topic->component; trunk/src/midcom.admin.styleeditor/locale/default.en.txt
r5478 r5778 4 4 ---LANGUAGE en 5 5 6 ---STRING add text file 7 Add text file 8 ---STRINGEND 9 6 10 ---STRING all style elements 7 11 All style elements 12 ---STRINGEND 13 14 ---STRING cascading style sheet 15 Cascading Style Sheet 8 16 ---STRINGEND 9 17 … … 12 20 ---STRINGEND 13 21 14 ---STRING style element list15 List of style elements16 ---STRINGEND17 18 ---STRING style elements for %s19 Style elements for style %s20 ---STRINGEND21 22 ---STRING style editor23 Style editor24 ---STRINGEND25 26 22 ---STRING copy to editor 27 23 Copy to editor 28 24 ---STRINGEND 29 25 30 ---STRING add text file 31 Add text file 32 ---STRINGEND 33 34 ---STRING cascading style sheet 35 Cascading Style Sheet 26 ---STRING create new element 27 Create new element 36 28 ---STRINGEND 37 29 … … 50 42 ---STRING edit text file 51 43 Edit text file 44 ---STRINGEND 45 46 ---STRING element %s exists 47 Element '%s' exists 48 ---STRINGEND 49 50 ---STRING element from file 51 Upload element 52 ---STRINGEND 53 54 ---STRING element name 55 Element name 52 56 ---STRINGEND 53 57 … … 76 80 ---STRINGEND 77 81 82 ---STRING plain text 83 Plain text 84 ---STRINGEND 85 78 86 ---STRING style attachments 79 87 Style attachments 88 ---STRINGEND 89 90 ---STRING style editor 91 Style editor 92 ---STRINGEND 93 94 ---STRING style element list 95 List of style elements 96 ---STRINGEND 97 98 ---STRING style elements for %s 99 Style elements for style %s 80 100 ---STRINGEND 81 101 … … 92 112 ---STRINGEND 93 113 94 ---STRING plain text95 Plain text 114 ---STRING element name required 115 Element name is required 96 116 ---STRINGEND 97 117 trunk/src/midcom.admin.styleeditor/static/style-editor.css
r5553 r5778 277 277 overflow: auto; 278 278 } 279 280 #midcom_admin_styleeditor_style div.message 281 { 282 color: red; 283 } trunk/src/midcom.admin.styleeditor/style/midcom-admin-styleeditor-style-edit.php
r5554 r5778 22 22 } 23 23 ?> 24 <form class="midcom_admin_styleeditor_styleeditor" method="post" action="."> 24 <form class="midcom_admin_styleeditor_styleeditor" method="post" action="." enctype="multipart/form-data"> 25 <fieldset> 26 <legend><?php echo $_MIDCOM->i18n->get_string('element from file', 'midcom.admin.styleeditor'); ?></legend> 27 <input type="file" name="midcom_admin_styleeditor_style_file" id="midcom_admin_styleeditor_style_file" class="file" /> 28 </fieldset> 25 29 <fieldset> 26 30 <legend><?php echo $_MIDCOM->i18n->get_string('local element', 'midcom.admin.styleeditor'); ?></legend> trunk/src/midcom.admin.styleeditor/viewer.php
r5448 r5778 62 62 'variable_args' => 1, 63 63 ), 64 64 /** 65 * Create new style element 66 * 67 * Match /create/ 68 * 69 */ 70 'style_element_create' => array 71 ( 72 'handler' => array ('midcom_admin_styleeditor_handler_create','create'), 73 'fixed_args' => array ('create'), 74 ), 65 75 /** 66 76 * Create a new file
