Changeset 5773
- Timestamp:
- 04/20/07 15:08:17 (2 years ago)
- Files:
-
- trunk/src/midcom.admin.folder/config/manifest.inc (modified) (2 diffs)
- trunk/src/midcom.admin.folder/documentation/CHANGES (modified) (1 diff)
- trunk/src/midcom.admin.folder/handler/create.php (modified) (1 diff)
- trunk/src/midcom.admin.folder/handler/order.php (modified) (10 diffs)
- trunk/src/midcom.admin.folder/locale/default.en.txt (modified) (5 diffs)
- trunk/src/midcom.admin.folder/locale/default.fi.txt (modified) (1 diff)
- trunk/src/midcom.admin.folder/static/midcom-admin-order.css (modified) (1 diff)
- trunk/src/midcom.admin.folder/style/midcom-admin-show-order-folders.php (modified) (1 diff)
- trunk/src/midcom.admin.folder/style/midcom-admin-show-order-header.php (modified) (2 diffs)
- trunk/src/midcom.admin.folder/style/midcom-admin-show-order-mixed.php (modified) (2 diffs)
- trunk/src/midcom.admin.folder/style/midcom-admin-show-order-pages.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/midcom.admin.folder/config/manifest.inc
r5203 r5773 23 23 ( 24 24 'name' => 'Arttu Manninen', 25 'email' => 'arttu .manninen@protie.fi',26 'role' => ' developer',25 'email' => 'arttu@kaktus.cc', 26 'role' => 'lead', 27 27 ), 28 28 'torben' => Array … … 39 39 ), 40 40 ), 41 42 trunk/src/midcom.admin.folder/documentation/CHANGES
r5715 r5773 7 7 - All items marked with "+" represent completly new features. 8 8 9 2007-04-16 bergie 10 + Added initial support for moving objects 9 2007-04-20 adrenalin 10 - Fixed bug in sorting more than 9 mixed objects (inserted leading zeros for each ID before 11 sorting the elements alphabetically) 12 - Improved user interface 13 - Added constraint to prevent reply articles (up <> 0) from appearing 14 - Removed XML prologues (<![CDATA[]]>) 15 16 2007-02-06 adrenalin 17 - Rollback to previous version of metadata editor: backporting from SVN trunk won't work 11 18 12 19 2007-02-02 adrenalin 20 ! Backported to MidCOM 2.6 branch 13 21 + Moved delete folder request to use static method instead of an independent function 14 22 and converted it to use midgard_query_builder instead of midcom_helper_nav (latter trunk/src/midcom.admin.folder/handler/create.php
r5205 r5773 208 208 ); 209 209 210 // loads and populats request_array['components'] 211 $style_default = array 212 ( 213 '' => $_MIDCOM->i18n->get_string('default', 'midcom.admin.folder'), 214 ); 215 216 $styles_all = midcom_admin_folder_folder_management::list_styles(); 217 218 $this->_request_data['styles'] = array_merge($style_default, $styles_all); 219 210 220 // Show the style element 211 221 midcom_show_style('midcom-admin-show-create-folder'); trunk/src/midcom.admin.folder/handler/order.php
r5151 r5773 40 40 if ($_POST['f_navorder'] != $this->_topic->parameter('midcom.helper.nav', 'navorder')) 41 41 { 42 $this->_topic-> parameter('midcom.helper.nav', 'navorder', $_POST['f_navorder']);43 return true;42 $this->_topic->set_parameter('midcom.helper.nav', 'navorder', $_POST['f_navorder']); 43 return false; 44 44 // This will exit. 45 45 } … … 52 52 { 53 53 $article = new midcom_db_article($id); 54 $article->score = $key;54 $article->score = (int) $key; 55 55 $article->metadata->score = (int) $count - $key; 56 56 … … 95 95 { 96 96 $topic = new midcom_db_topic($id); 97 $topic->score = $key;97 $topic->score = (int) $key; 98 98 $topic->metadata->score = (int) $count - $key; 99 99 … … 169 169 } 170 170 171 $object->score = $key;171 $object->score = (int) $key; 172 172 173 173 debug_add("Setting the score for {$type[1]} id '{$id}: {$key}", MIDCOM_LOG_DEBUG); … … 194 194 195 195 debug_pop(); 196 197 return true; 196 198 } 197 199 … … 226 228 if (array_key_exists('f_submit', $_REQUEST)) 227 229 { 228 $this->_process_order_form(); 229 $_MIDCOM->relocate($_MIDCOM->permalinks->create_permalink($this->_topic->guid)); 230 if ($this->_process_order_form()) 231 { 232 $_MIDCOM->relocate($_MIDCOM->permalinks->create_permalink($this->_topic->guid)); 233 } 230 234 // This will exit 231 235 } … … 233 237 // Add the view to breadcrumb trail 234 238 $tmp = array(); 239 235 240 $tmp[] = array 236 241 ( … … 287 292 $qb->add_constraint('topic', '=', $this->_topic->id); 288 293 $qb->add_constraint('name', '<>', 'index'); 294 $qb->add_constraint('up', '=', 0); 289 295 $qb->add_order('score'); 290 296 //$qb->add_order('name'); … … 331 337 foreach ($this->_request_data['folders'] as $topic) 332 338 { 333 $this->_request_data['mixed'][$topic->score . '_' . $topic->id . '_folder'] = $topic->extra; 339 $score = $this->_get_score($topic->score); 340 $this->_request_data['mixed'][$score . '_' . $topic->id . '_folder'] = $topic->extra; 334 341 } 335 342 336 343 foreach ($this->_request_data['pages'] as $article) 337 344 { 338 $this->_request_data['mixed'][$article->score . '_' . $article->id . '_page'] = $article->title; 345 $score = $this->_get_score($article->score); 346 $this->_request_data['mixed'][$score . '_' . $article->id . '_page'] = $article->title; 339 347 } 340 348 … … 369 377 midcom_show_style('midcom-admin-show-order-footer'); 370 378 } 379 380 /** 381 * Fill a given integer with zeros for alphabetic ordering 382 * 383 * @access private 384 * @param int $int Integer 385 * @return string String filled with leading zeros 386 */ 387 function _get_score($int) 388 { 389 $string = (string) $int; 390 391 while (strlen($string) < 5) 392 { 393 $string = "0{$string}"; 394 } 395 396 return $string; 397 } 371 398 } 372 399 ?> trunk/src/midcom.admin.folder/locale/default.en.txt
r5715 r5773 12 12 ---STRINGEND 13 13 14 ---STRING all style elements 15 All style elements 16 ---STRINGEND 17 14 18 ---STRING are you sure you want to delete this folder 15 19 Are you sure you want to delete this folder? … … 32 36 ---STRINGEND 33 37 38 ---STRING component default 39 Component default 40 ---STRINGEND 41 42 ---STRING copy to editor 43 Copy to editor 44 ---STRINGEND 45 34 46 ---STRING create folder 35 47 Create folder … … 88 100 ---STRINGEND 89 101 102 ---STRING edit layout template 103 Edit layout template 104 ---STRINGEND 105 90 106 ---STRING edit metadata 91 107 Edit metadata … … 144 160 ---STRINGEND 145 161 162 ---STRING nav order 163 Order of navigation items 164 ---STRINGEND 165 166 ---STRING new layout template 167 [New layout template] 168 ---STRINGEND 169 170 ---STRING no sortable elements found 171 No sortable elements found 172 ---STRINGEND 173 174 ---STRING no url name specified 175 No URL name specified! 176 ---STRINGEND 177 178 ---STRING order navigation 179 Arrange navigation items 180 ---STRINGEND 181 182 ---STRING order navigation in folder %s 183 Arrange navigation under folder "%s" 184 ---STRINGEND 185 186 ---STRING owner 187 Owner 188 ---STRINGEND 189 190 ---STRING pages first 191 Pages first 192 ---STRINGEND 193 194 ---STRING prevent entering 195 Prevent entering 196 ---STRINGEND 197 198 ---STRING privilege template_management 199 Layout template management 200 ---STRINGEND 201 202 ---STRING privilege topic_management 203 Folder management 204 ---STRINGEND 205 206 ---STRING published 207 Published 208 ---STRINGEND 209 210 ---STRING revised 211 Revised 212 ---STRINGEND 213 214 ---STRING revision 215 Revision 216 ---STRINGEND 217 218 ---STRING revisor 219 Revisor 220 ---STRINGEND 221 222 ---STRING schedule end 223 Display until (leave empty for unlimited display) 224 ---STRINGEND 225 226 ---STRING schedule start 227 Publish at (leave empty for immediate publication) 228 ---STRINGEND 229 230 ---STRING scheduling 231 Scheduling 232 ---STRINGEND 233 234 ---STRING select the ordering method first to sort the pages 235 Select the ordering method first to sort the pages 236 ---STRINGEND 237 238 ---STRING size 239 Size 240 ---STRINGEND 241 242 ---STRING sort by score 243 Sort by score 244 ---STRINGEND 245 246 ---STRING sort folders 247 Sort folders 248 ---STRINGEND 249 250 ---STRING sort pages 251 Sort pages 252 ---STRINGEND 253 254 ---STRING style 255 Style template 256 ---STRINGEND 257 258 ---STRING style editor 259 Style editor 260 ---STRINGEND 261 262 ---STRING style element list 263 List of style elements 264 ---STRINGEND 265 266 ---STRING style elements for %s 267 Style elements for style %s 268 ---STRINGEND 269 270 ---STRING title is empty 271 Title is empty! 272 ---STRINGEND 273 274 ---STRING warning, might result in data loss 275 Warning! Might result in data loss! 276 ---STRINGEND 277 278 ---STRING saving changes 279 Saving changes 280 ---STRINGEND 281 146 282 ---STRING move 147 283 Move 148 284 ---STRINGEND 149 285 150 ---STRING nav order151 Order of navigation items152 ---STRINGEND153 154 ---STRING new layout template155 [New layout template]156 ---STRINGEND157 158 ---STRING no sortable elements found159 No sortable elements found160 ---STRINGEND161 162 ---STRING no url name specified163 No URL name specified!164 ---STRINGEND165 166 ---STRING order navigation167 Arrange navigation items168 ---STRINGEND169 170 ---STRING order navigation in folder %s171 Arrange navigation under folder "%s"172 ---STRINGEND173 174 ---STRING owner175 Owner176 ---STRINGEND177 178 ---STRING pages first179 Pages first180 ---STRINGEND181 182 ---STRING prevent entering183 Prevent entering184 ---STRINGEND185 186 ---STRING privilege template_management187 Layout template management188 ---STRINGEND189 190 ---STRING privilege topic_management191 Folder management192 ---STRINGEND193 194 ---STRING published195 Published196 ---STRINGEND197 198 ---STRING revised199 Revised200 ---STRINGEND201 202 ---STRING revision203 Revision204 ---STRINGEND205 206 ---STRING revisor207 Revisor208 ---STRINGEND209 210 ---STRING schedule end211 Display until (leave empty for unlimited display)212 ---STRINGEND213 214 ---STRING schedule start215 Publish at (leave empty for immediate publication)216 ---STRINGEND217 218 ---STRING scheduling219 Scheduling220 ---STRINGEND221 222 ---STRING select the ordering method first to sort the pages223 Select the ordering method first to sort the pages224 ---STRINGEND225 226 ---STRING size227 Size228 ---STRINGEND229 230 ---STRING sort by score231 Sort by score232 ---STRINGEND233 234 ---STRING sort folders235 Sort folders236 ---STRINGEND237 238 ---STRING sort pages239 Sort pages240 ---STRINGEND241 242 ---STRING style243 Style template244 ---STRINGEND245 246 286 ---STRING title is empty 247 287 Title is empty! … … 255 295 Move %s 256 296 ---STRINGEND 257 trunk/src/midcom.admin.folder/locale/default.fi.txt
r5715 r5773 248 248 ---STRINGEND 249 249 250 ---STRING list of %s folders using the same style template path 251 Lista komponenttia "%s" kÀyttÀvistÀ kansioista, joissa kÀytetÀÀn samaa tyylipolkua 252 ---STRINGEND 253 254 ---STRING style element list 255 Tyylielementtilista 256 ---STRINGEND 257 258 ---STRING style elements for %s 259 Tyylielementit tyylille %s 260 ---STRINGEND 261 262 ---STRING all style elements 263 Kaikki tyylielementit 264 ---STRINGEND 265 266 ---STRING component default 267 Komponentin vakiotyyli 268 ---STRINGEND 269 270 ---STRING edit %s 271 Muokkaa kohdetta '%s' 272 ---STRINGEND 273 274 ---STRING local element 275 Paikallinen elementti 276 ---STRINGEND 277 278 ---STRING copy to editor 279 Kopioi editoriin 280 ---STRINGEND 281 282 ---STRING style editor 283 Ulkoasueditori 284 ---STRINGEND 285 286 ---STRING submitting the form 287 Tallennetaan muutos 288 ---STRINGEND 289 trunk/src/midcom.admin.folder/static/midcom-admin-order.css
r4032 r5773 9 9 font-weight: bold; 10 10 } 11 12 #midcom_admin_folder_show_save_info 13 { 14 background-image: url('../midcom.helper.datamanager2/ajax-loading-black.gif'); 15 background-repeat: no-repeat; 16 background-position: center center; 17 background-color: black; 18 color: white; 19 padding: 1em; 20 display: none; 21 } trunk/src/midcom.admin.folder/style/midcom-admin-show-order-folders.php
r5049 r5773 11 11 ?> 12 12 </ul> 13 <script> 14 Sortable.create('midcom_admin_content_folders_list'); 13 <script type="text/javascript"> 14 // <!-- 15 Sortable.create('midcom_admin_content_folders_list'); 16 // --> 15 17 </script> 16 18 </div> trunk/src/midcom.admin.folder/style/midcom-admin-show-order-header.php
r5151 r5773 1 <script> 2 function midcom_admin_content_hide_ordering_lists() 3 { 4 var elements = document.getElementsByClassName('midcom-admin-order'); 5 var i = 0; 6 7 for (i = 0; i < elements.length; i++) 8 { 9 var element = elements[i]; 10 element.style.display = 'none'; 11 } 12 } 1 <script type="text/javascript"> 2 // <!-- 3 function disable_sorting() 4 { 5 document.getElementById('midcom_admin_folder_show_save_info').style.display = 'block'; 6 var input = document.createElement('input'); 7 input.type = 'hidden'; 8 input.name = 'f_submit'; 9 input.value = 'submit'; 10 11 document.getElementById('midcom_admin_folder_order_form').appendChild(input); 12 document.getElementById('midcom_admin_folder_order_form').submit(); 13 } 14 // --> 13 15 </script> 14 <?php15 //$data =& $_MIDCOM->get_custom_context_data('request_data');16 ?>17 16 <h1><?php echo $data['title']; ?></h1> 18 <form method="post" action="" enctype="multipart/form-data" id="midcom_admin_ content_order_form" class="datamanager midcom_admin_folder sort_folder">17 <form method="post" action="" enctype="multipart/form-data" id="midcom_admin_folder_order_form" class="datamanager midcom_admin_folder sort_folder"> 19 18 <label for="midcom_admin_content_order_navorder"> 20 <select name="f_navorder" id="midcom_admin_ content_order_navorder" onChange="midcom_admin_content_hide_ordering_lists();">19 <select name="f_navorder" id="midcom_admin_folder_order_navorder" onChange="javascript:disable_sorting();"> 21 20 <?php 22 21 foreach ($data['navorder_list'] as $key => $value) … … 37 36 </select> 38 37 </label> 38 <p id="midcom_admin_folder_show_save_info" style=""> 39 <?php echo $_MIDCOM->i18n->get_string('saving changes', 'midcom.admin.folder'); ?> 40 </p> trunk/src/midcom.admin.folder/style/midcom-admin-show-order-mixed.php
r5048 r5773 1 <div class="midcom-admin-order" style="display: block;">2 1 <?php 3 2 //$data =& $_MIDCOM->get_custom_context_data('request_data'); 4 3 ?> 4 <div class="midcom-admin-order" style="display: block;"> 5 5 <h3><?php echo $_MIDCOM->i18n->get_string('sort by score', 'midcom.admin.folder'); ?></h3> 6 6 <ul id="midcom_admin_content_mixed_list" class="mixed sortable"> … … 24 24 ?> 25 25 </ul> 26 <script> 27 Sortable.create('midcom_admin_content_mixed_list'); 26 <script type="text/javascript"> 27 // <!-- 28 Sortable.create('midcom_admin_content_mixed_list'); 29 // --> 28 30 </script> 29 31 </div> trunk/src/midcom.admin.folder/style/midcom-admin-show-order-pages.php
r5048 r5773 14 14 ?> 15 15 </ul> 16 <script> 17 Sortable.create('midcom_admin_content_pages_list'); 16 <script type="text/javascript"> 17 // <!-- 18 Sortable.create('midcom_admin_content_pages_list'); 19 // --> 18 20 </script> 19 21 </div>
