Changeset 5067
- Timestamp:
- Mar 6, 2010, 11:10:23 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin.php
r5014 r5067 34 34 // +-----------------------------------------------------------------------+ 35 35 check_status(ACCESS_ADMINISTRATOR); 36 37 // tags 38 if (isset($_GET['fckb_tags'])) 39 { 40 $query = ' 41 SELECT 42 id, 43 name 44 FROM '.TAGS_TABLE.' 45 ;'; 46 $result = pwg_query($query); 47 $taglist = array(); 48 while ($row = pwg_db_fetch_assoc($result)) 49 { 50 array_push( 51 $taglist, 52 array( 53 'caption' => $row['name'], 54 'value' => '~~'.$row['id'].'~~', 55 ) 56 ); 57 } 58 echo json_encode($taglist); 59 exit(); 60 } 36 61 37 62 // +-----------------------------------------------------------------------+ -
trunk/admin/picture_modify.php
r5021 r5067 107 107 ); 108 108 109 // In $_POST[tags] we receive something like array('~~6~~', '~~59~~', 'New 110 // tag', 'Another new tag') The ~~34~~ means that it is an existing 111 // tag. I've added the surrounding ~~ to permit creation of tags like "10" 112 // or "1234" (numeric characters only) 113 $tag_ids = array(); 114 if (isset($_POST['tags'])) 115 { 116 foreach ($_POST['tags'] as $raw_tag) 117 { 118 if (preg_match('/^~~(\d+)~~$/', $raw_tag, $matches)) 119 { 120 array_push($tag_ids, $matches[1]); 121 } 122 else 123 { 124 // we have to create a new tag 125 array_push( 126 $tag_ids, 127 tag_id_from_tag_name($raw_tag) 128 ); 129 } 130 } 131 } 132 109 133 set_tags( 110 isset($_POST['tags']) ? $_POST['tags'] : array(),134 $tag_ids, 111 135 $_GET['image_id'] 112 136 ); … … 170 194 } 171 195 196 // tags 197 $tags = array(); 198 199 $query = ' 200 SELECT 201 tag_id, 202 name 203 FROM '.IMAGE_TAG_TABLE.' AS it 204 JOIN '.TAGS_TABLE.' AS t ON t.id = it.tag_id 205 WHERE image_id = '.$_GET['image_id'].' 206 ;'; 207 $result = pwg_query($query); 208 while ($row = pwg_db_fetch_assoc($result)) 209 { 210 array_push( 211 $tags, 212 array( 213 'value' => '~~'.$row['tag_id'].'~~', 214 'caption' => $row['name'], 215 ) 216 ); 217 } 218 172 219 // retrieving direct information about picture 173 220 $query = ' … … 185 232 186 233 $image_file = $row['file']; 187 188 // tags189 $query = '190 SELECT tag_id191 FROM '.IMAGE_TAG_TABLE.'192 WHERE image_id = '.$_GET['image_id'].'193 ;';194 $selected_tags = array_from_query($query, 'tag_id');195 234 196 235 // +-----------------------------------------------------------------------+ … … 204 243 ); 205 244 206 $all_tags = get_all_tags();207 208 if (count($all_tags) > 0)209 {210 $tag_selection = get_html_tag_selection(211 $all_tags,212 'tags',213 $selected_tags214 );215 }216 else217 {218 $tag_selection =219 '<p>'.220 l10n('No tag defined. Use Administration>Pictures>Tags').221 '</p>';222 }223 224 245 $template->assign( 225 246 array( 247 'tags' => $tags, 226 248 'U_SYNC' => 227 249 get_root_url().'admin.php?page=picture_modify'. … … 245 267 246 268 'AUTHOR' => isset($_POST['author']) ? $_POST['author'] : @$row['author'], 247 248 'TAG_SELECTION' => $tag_selection,249 269 250 270 'DESCRIPTION' => -
trunk/admin/template/goto/default-layout.css
r3283 r5067 456 456 cursor : pointer; 457 457 } 458 459 /* jQuery FCBKcomplete */ 460 /* TextboxList sample CSS */ 461 ul.holder { margin: 0; border: 1px solid #999; overflow: hidden; height: auto !important; height: 1%; padding: 4px 5px 0; } 462 *:first-child+html ul.holder { padding-bottom: 2px; } * html ul.holder { padding-bottom: 2px; } /* ie7 and below */ 463 ul.holder li { float: left; list-style-type: none; margin: 0 5px 4px 0; white-space:nowrap;} 464 ul.holder li.bit-box, ul.holder li.bit-input input { font: 11px "Lucida Grande", "Verdana"; } 465 ul.holder li.bit-box { -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; border: 1px solid #CAD8F3; background: #DEE7F8; padding: 1px 5px 2px; } 466 ul.holder li.bit-box-focus { border-color: #598BEC; background: #598BEC; color: #fff; } 467 ul.holder li.bit-input input { width: auto; overflow:visible; margin: 0; border: 0px; outline: 0; padding: 3px 0px 2px; } /* no left/right padding here please */ 468 ul.holder li.bit-input input.smallinput { width: 20px; } 469 470 /* Facebook demo CSS */ 471 #add { border: 1px solid #999; width: 550px; margin: 50px; padding: 20px 30px 10px; } 472 form ol li { list-style-type: none; } 473 form ol { font: 11px "Lucida Grande", "Verdana"; margin: 0; padding: 0; } 474 form ol li.input-text { margin-bottom: 10px; list-style-type: none; padding-bottom: 10px; } 475 form ol li.input-text label { font-weight: bold; cursor: pointer; display: block; font-size: 13px; margin-bottom: 10px; } 476 form ol li.input-text input { width: 500px; padding: 5px 5px 6px; font: 11px "Lucida Grande", "Verdana"; border: 1px solid #999; } 477 form ul.holder { width: 500px; } 478 form ul { margin: 0 !important } 479 ul.holder li.bit-box, #apple-list ul.holder li.bit-box { padding-right: 15px; position: relative; z-index:1000;} 480 #apple-list ul.holder li.bit-input { margin: 0; } 481 #apple-list ul.holder li.bit-input input.smallinput { width: 5px; } 482 ul.holder li.bit-hover { background: #BBCEF1; border: 1px solid #6D95E0; } 483 ul.holder li.bit-box-focus { border-color: #598BEC; background: #598BEC; color: #fff; } 484 ul.holder li.bit-box a.closebutton { position: absolute; right: 4px; top: 5px; display: block; width: 7px; height: 7px; font-size: 1px; background: url(icon/fcbkcomplete_close.gif); } 485 ul.holder li.bit-box a.closebutton:hover { background-position: 7px; } 486 ul.holder li.bit-box-focus a.closebutton, ul.holder li.bit-box-focus a.closebutton:hover { background-position: bottom; } 487 488 /* Autocompleter */ 489 490 .facebook-auto { display: none; position: absolute; width: 512px; background: #eee; } 491 .facebook-auto .default { padding: 5px 7px; border: 1px solid #ccc; border-width: 0 1px 1px;font-family:"Lucida Grande","Verdana"; font-size:11px; } 492 .facebook-auto ul { display: none; margin: 0; padding: 0; overflow: auto; position:absolute; z-index:9999} 493 .facebook-auto ul li { padding: 5px 12px; z-index: 1000; cursor: pointer; margin: 0; list-style-type: none; border: 1px solid #ccc; border-width: 0 1px 1px; font: 11px "Lucida Grande", "Verdana"; background-color: #eee } 494 .facebook-auto ul li em { font-weight: bold; font-style: normal; background: #ccc; } 495 .facebook-auto ul li.auto-focus { background: #4173CC; color: #fff; } 496 .facebook-auto ul li.auto-focus em { background: none; } 497 .deleted { background-color:#4173CC !important; color:#ffffff !important;} 498 .hidden { display:none;} 499 500 #demo ul.holder li.bit-input input { padding: 2px 0 1px; border: 1px solid #999; } 501 .ie6fix {height:1px;width:1px; position:absolute;top:0px;left:0px;z-index:1;} -
trunk/admin/template/goto/picture_modify.tpl
r5021 r5067 1 2 1 {include file='include/autosize.inc.tpl'} 3 2 {include file='include/dbselect.inc.tpl'} 4 3 {include file='include/datepicker.inc.tpl'} 4 5 {known_script id="jquery.fcbkcomplete" src=$ROOT_URL|@cat:"template-common/lib/plugins/jquery.fcbkcomplete.js"} 6 {literal} 7 <script type="text/javascript"> 8 $(document).ready(function() { 9 $("#tags").fcbkcomplete({ 10 json_url: "admin.php?fckb_tags=1", 11 cache: false, 12 filter_case: true, 13 filter_hide: true, 14 firstselected: true, 15 filter_selected: true, 16 maxitems: 10, 17 newel: true 18 }); 19 }); 20 </script> 21 {/literal} 5 22 6 23 {literal} … … 120 137 <tr> 121 138 <td><strong>{'Tags'|@translate}</strong></td> 122 <td>{$TAG_SELECTION}</td> 139 <td> 140 <select id="tags" name="tags"> 141 {foreach from=$tags item=tag} 142 <option value="{$tag.value}" class="selected">{$tag.caption}</option> 143 {/foreach} 144 </select> 145 </td> 123 146 </tr> 124 147
Note: See TracChangeset
for help on using the changeset viewer.