Changeset 1739
- Timestamp:
- 05/17/08 05:18:16 (8 months ago)
- Location:
- trunk/htdocs/system
- Files:
-
- 1 added
- 2 modified
-
admin/tag_collection.php (added)
-
admin/tags.php (modified) (2 diffs)
-
classes/adminhandler.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/htdocs/system/admin/tags.php
r1732 r1739 8 8 <span class="newer pct10"><a href="#">Newer »</a></span> 9 9 </div> 10 <?php 11 $tags= $available_tags; 12 //what's the max count? 13 //ugly! and probably needs to be a Tags method or something 14 $max=0; 15 foreach ($tags as $tag){if ($max < $tag->count) $max=$tag->count;} 16 ?> 17 <div class="container tags"> 18 <?php foreach ($tags as $tag) { ?> 19 <a href="#" id="<?php echo 'tag_' . $tag->id ?>" class="tag wt<?php echo round(($tag->count * 10)/$max); ?>"><span><?php echo $tag->tag; ?></span><sup><?php echo $tag->count; ?></sup></a> 20 <?php } ?> 21 <ul class="dropbutton"> 22 <li><a href="#">Select Visible</a></li> 23 <li><a href="#">Select All</a></li> 24 <li><a href="#">Deselect All</a></li> 25 </ul> 10 <div id="tag_collection" class="container tags"> 11 <?php $theme->display( 'tag_collection' ); ?> 26 12 </div> 27 13 … … 116 102 //TODO When there's a loupe, update it 117 103 //timelineHandle.updateLoupeInfo(); 118 master_found= false; 119 // Update the master tag count 120 $('.tags .tag:contains(' + master + ')').each(function() { 121 if ($(this).find('span').text() == master) { 122 $(this).find('sup').text(data['count']); 123 // TODO should change the wt%d class 124 master_found= true; 125 } 126 }) 127 // master wasn't an existing tag, add it to the list 128 // It's going to be last, not in order 129 if (!master_found) { 130 $('.tags .tag:last').after('<a href="#" id="tag_' + data['id'] + '" class="tag wt' + data['wt'] + '"><span>' + master + '</span><sup>' + data['count'] + '</sup></a>'); 131 $('.tags .tag:last').click(function() { 104 $('#tag_collection').html(data['tags']); 105 $('.tags .tag').click(function() { 132 106 $(this).toggleClass('selected'); 133 107 tagManage.changeTag(); 134 } );135 }136 selected.remove();108 } 109 ); 110 tagManage.changeTag(); 137 111 humanMsg.displayMsg(data['msg']); 138 112 }, -
trunk/htdocs/system/classes/adminhandler.php
r1726 r1739 471 471 $this->theme->assign( 'settings', $settings ); 472 472 } 473 $this->theme->display( 'users');473 $this->theme->display( 'users' ); 474 474 } 475 475 } … … 1360 1360 { 1361 1361 $this->theme->wsse= Utils::WSSE(); 1362 $this->theme->available_tags= Tags::get();1363 1362 $this->display( 'tags' ); 1364 1363 } … … 1393 1392 case 'rename': 1394 1393 if ( isset($this->handler_vars['master']) ) { 1394 $theme_dir= Plugins::filter( 'admin_theme_dir', Site::get_dir( 'admin_theme', TRUE ) ); 1395 $this->theme= Themes::create( 'admin', 'RawPHPEngine', $theme_dir ); 1395 1396 $master= $this->handler_vars['master']; 1396 1397 $tag_names= array(); … … 1405 1406 Tags::rename($master, $tag_names); 1406 1407 $msg_status= sprintf( _t('Tags %s have been renamed to %s.'), implode($tag_names, ', '), $master ); 1407 $master= Tags::get_one( $master ); 1408 $wt= round(($master->count * 10)/$master->count); 1409 echo json_encode( array( 'msg' => $msg_status, 'count' => $master->count, 'id' => $master->id, 'wt' => $wt ) ); 1408 echo json_encode( array( 'msg' => $msg_status, 'tags' => $this->theme->fetch( 'tag_collection' ) ) ); 1410 1409 } 1411 1410 break;
